How to set the value if it exists, otherwise store an empty string with GET
Options
![Xano Support Chat](https://us.v-cdn.net/6037124/uploads/userpics/FKYXLB95T7IC/nMGWYAJV7MBEL.jpeg)
Xano Support Chat
Administrator
ADMIN
Hello, is there a best practice when one is receiving a variable from an API payload and it's uncertain if the variable will be set?
I am unsure if the earliest will be set, so I have configured as such:
is this what you would recommend? basically, i want to set the value if it exists, otherwise store an empty string
Tagged:
Best Answer
-
You're almost there! You want to move your variable onto the value line above. And apply the GET filter to the variable. GET can be thought of like a "dot" in dot notation. So your setup should look like this:
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