How to avoid error "Unable to locate var"

Options
pachocastillosr
pachocastillosr Member
edited July 2023 in ? Help! I'm a Noob

Hi,

I have two objects: variant_in_client_catalog and variant_to_update.0

Sometimes they have the .size path sometimes they don't.

I am building an IF action which evaluates if the .size value of both objects are equal.

The problem is: whenever any of both objects don't have the .size path, the "Unable to locate var" error is returned (as seen in the screenshot).


I tried this but still getting the same error:


Note: variant_in_client_catalog comes from an external API so I can't just create it with the .size path and I can't add the .size path after I receive the object from the external API because sometimes it does have the size path and that would overwrite it, deleting the size received from the external API.

What can I do to avoid this error?

Thanks!

Best Answer

  • Lachlan
    Lachlan Administrator

    ADMIN

    Answer ✓
    Options

    Hi there @pachocastillosr I think you are very close with your logic!

    Where you have used your get filter is correct, however, you will note that the Variable that you have applied the filter to is empty. (It just say's "text")

    If you instead inserted the variable variant_in_client_catalog and then for your get filter you are just going to use the path size and this should work.

    Let me know how you go!

Answers