I have a front end REST API to temporarily display information for a user based on what they enter in. It works well when the entry is valid. However, if the entry is not valid, the last valid data remains. So to the user, it would appear the entry is still valid.
I am trying to look for some sort of return variable accessible in weweb’s formulas as to whether the REST API has a currently successful response or not. ‘isfetched and fetching’ doesn’t denote whether the fetch was successful.
I can only think of the alternative of performing the REST API call within a workflow instead of as an overall collection. Creating a temporary variable with the data I want from that rest API call. This doesn’t seem like a clean solution, so I wanted to check first.
If you are not using a form selection then you will need to look at what is returned from the {}data element that you have in your first image. The {}data length will either be 0 or or {}data will be null/empty.
If you control the endpoint you can also send a status value back such as isValid=true or isValid=false
And return the data on success or return an error value on failure.
There are some posts on this site where people ask questions about and use axios Search results for 'axios' - WeWeb Community
which may give you some insight.