Logic to check whether API output contains a field?
Options
Marianna Kerppola
Member ✭
Hello!
I've set up a an external API endpoint to get data from Airtable. If a field is blank in Airtable, the json response will not include that field at all, rather than sending it as null. Is there a way to set up a condition in Xano to check whether the Airtable result contains a certain field to handle these separate conditions?
Here's a video illustrating a specific scenario:
https://www.loom.com/share/185ecee4d2b749c99e7c6d5981cff460
Thanks!
Marianna
I've set up a an external API endpoint to get data from Airtable. If a field is blank in Airtable, the json response will not include that field at all, rather than sending it as null. Is there a way to set up a condition in Xano to check whether the Airtable result contains a certain field to handle these separate conditions?
Here's a video illustrating a specific scenario:
https://www.loom.com/share/185ecee4d2b749c99e7c6d5981cff460
Thanks!
Marianna
Comments
-
I think I'm part of the way there by getting the Object Keys from the Airtable json output. Then filtering that result for whether it has the key I'm looking for... Unfortunately, I'm still running into errors when running, so needs more debugging. 🤔
[Screen Shot 2021-07-21 at 5.16.20 PM.png][Screen Shot 2021-07-21 at 5.16.39 PM.png] -
Try to GET first only fields ( default null ) then try GET focusId ( default null ) and see if works . If i am not wrong I had something similar check my post: https://community.xano.com/c/request-a-feature/set_ifhas-conditional-filter
-
Fantastic! Thanks for the tip! I got it to work!
-
👏 happy to now that worked !
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