How to avoid error "Unable to locate var"
![pachocastillosr](https://us.v-cdn.net/6037124/uploads/userpics/MC7ELS8NG1HC/nPLP98RNMYYEZ.jpg)
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
-
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 variablevariant_in_client_catalog
and then for your get filter you are just going to use the pathsize
and this should work.Let me know how you go!
Answers
-
@Lachlan that worked! Thanks!
-
No worries! Glad it is working, thanks for including the detailed screenshots / explanation :)
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