How to add an "If Error" to API

Options
Is there a way to add a line in the API that returns null if a certain function  line returns an error?

Comments

  • Mitch
    Mitch Member
    Options
    Not sure if there's anything cleaner, but you could do logic on the receiving end to respond to the different response codes.
  • Abdullah Abdulkareem
    Options
    Thank you ! The challenge is the entire API fails and returns an error, whereas I want to "isolate" the variable that's causing the error and return it as null if that's helpful
  • Mitch
    Mitch Member
    Options
      ah okay.  I think I'm following.  Is the error getting thrown because the variable isn't used in all the conditional paths?  If so, what I do is assign the variable at the top of the function stack - and then, when I would normally use "create variable" I use "update variable" instead.

    If that's not the issue, what's causing the error to get thrown?