How to set the value if it exists, otherwise store an empty string with GET

Options
Xano Support Chat
Xano Support Chat Administrator

ADMIN

edited November 2022 in ? Help! I'm a Noob

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

Best Answer

  • Xano Support Chat
    Xano Support Chat Administrator

    ADMIN

    edited November 2022 Answer ✓
    Options

    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: