How to add exceptional handling on the service rest

Hi all developers and community members, I have a requirement to show “User details not found” on UI whenever we give customer id like C01X, whenever such user id not found.

→ I configured to show user details when they are found but I want to through an exception when user id not found

→ Please see the below attachments

@Dharma_Pati

When there is no record, the pyHTTPResponseCode should not be 200. Based on this you can set your exception logic. Or you can set in .Response.ResponseProperty.CustomerID==“”.

But are you using connect REST to retrieve data from a table via Obj-Browse? That is not recommended as REST is an expensive tool to be used for retrieving data within the same system.