I am calling an API get product details from barcodelookup.com, in most cases I get the details but when a product is new and the provider doesn’t have the product in their DB I get a blank response, is there a way handle this exception in Adalo when the API response is blank?
I have no experience using the API you mention but might have a solution.
Maybe you could set up an invisbile input field, make the API call and set an action to add the result to the invisbile input field. Then set a ‘no results’ gif or image to only show if the invisible input is empty. Do you think that would work?
I would have to disagree in this instance, getting no response can be handled with an action to update an input field, if their is no response then the field stays blank and therefore allowing you to control other fields and actions. I have just set an example up and it worked as I imagined.
@crmorris2 unfortunately not, based on the screenshot below, I can’t use the return values in a custom action to determine whether there’s a response from the API yet.
The workaround though is to create a temp collection from the response and then check the values in the temp collection to see if the values are blank (which is too long winded and defeats the purpose of using external collections )
@crmorris2 apologies, the clonable version assumes you know the response to show “No Results Found”, in my case I am using an external API call to fetch records and I can’t use them unless I store results first into a collection.
Would you be able to connect your clonable version to version to external API and confirm if this works please? I’d love to use it and it solves my biggest roadblock
Apologies, I did’t realise custom actions do not copy over in a clone. PM me your email address and I will add you as a team member in the app so you can see how it is built.