Multiplying aggregate sum with another variable "list*float" errors?
Options
Hello all.
I've taken a list of numbers, made their aggregate sum, and created a variable with that value.
I've also found the value that I want to multiply this aggregate sum variable with.
I can run everything successfully up to this point. I can have my response show my list with the aggregate sum and its table reference Id, I can have it show the variable that is that sum, I can have it show the variable that is the value I wan't to multiply that sum with.
But when I go and multiply the two, I get a variety of errors each way I'm attempting it.
I get "list*float" error most commonly.
Any thoughts on how to fix this?
I've tried making a new variable that is the previous 2 multiplied, and just tried updating variables even and can't get it to respond correctly.
I've taken a list of numbers, made their aggregate sum, and created a variable with that value.
I've also found the value that I want to multiply this aggregate sum variable with.
I can run everything successfully up to this point. I can have my response show my list with the aggregate sum and its table reference Id, I can have it show the variable that is that sum, I can have it show the variable that is the value I wan't to multiply that sum with.
But when I go and multiply the two, I get a variety of errors each way I'm attempting it.
I get "list*float" error most commonly.
Any thoughts on how to fix this?
I've tried making a new variable that is the previous 2 multiplied, and just tried updating variables even and can't get it to respond correctly.
Comments
-
It sounds like you are trying to do manipulation to a list. You must iterate through a list with a loop anytime you want to do something to it.
I'd suggest a For Each Loop through the list from the query all records.
Then an update variable with the new field and the multiplication you want to do. For example:
[CleanShot 2021-12-07 at 17.43.21.png] -
[image.png]
https://www.xano.com/snippet/OlcrkTzw
So, I managed to get it to work without using a Loop. But obviously I worry that I'll be learning a bad habit that makes things harder for me.
I used an array sum while querying all electric bills
[image.png]Then I turned it into a variable in step 5 and used the get function to convert that into a number.
[image.png]
Based on what I'm hearing from you this is far from best practice i take it?
This is the first API and workflow I've ever created. Being brand new, i expect i'm taking the long way for many things.
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