Set & Get Fun
Options
![Brian Giometti](https://us.v-cdn.net/6037124/uploads/userpics/ONIPTIEX0LDD/nJE4ZN6ATNTPB.png)
Brian Giometti
Member ✭
Why does this work for Update Variable but not Add Number? [image.png]When doing an add number I get[image.png]
Some Context:[image.png]Trying to loop through the totals object on calculator that has a set of entries corresponding to entries in an associated list of accounts for which I'd like to add and total (hope that's not too convoluted).
Some Context:[image.png]Trying to loop through the totals object on calculator that has a set of entries corresponding to entries in an associated list of accounts for which I'd like to add and total (hope that's not too convoluted).
Comments
-
type in "key" instead of making it a variable accidentally. I've made this mistake too
-
Thanks , but in this case it is a variable. I'm pulling keys from the initial object's schema and iterating through them. But I can relate, I think I've finally gotten into the habit of always clicking the variable name regardless of whether I'm typing, copy/pasting, etc
-
I don't think it likes me using the original object as the existing variable in add number, the update variable seems to handle it OK
-
Add number requires integers or decimals only to be used. Variables are more flexible and can hold different data types as well as more complex ones like full objects and arrays
-
When using set you are creating an object with a key-value pair... a number can only be a raw integer or decimal
-
Thanks makes sense. Seemed a little odd at the time, but now I get it. Just to close the loop here's where I ended up. Couple of variables is all it took to work around. Added a couple of conditionals to help with null values as well.[image.png]
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