Any standard way to ensure that non-existence of path does not result in an API error
Options
vk
Member ✭
Hi! In an array of objects, some elements might have a missing path (or diff structure) which leads to failing of the entire API. Can it be mitigated somehow?
Eg: [{"id":1,"name":"alpha","score":90},{"id":2,"name":"beta"}]
If I am running through a loop and accessing score path, I want my API to accept it as null/empty rather than generating an error that stops the whole API.
Best Answer
-
Hi,
try to use "get" filter instead of dot notation. It will allow you to assign a value like "null" to a path if Xano will not find it in object.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback