Hi,
If I understood correctly, you were able to convert you CSV data into a JSON array, and now need to sum the Gift Amount property from all objects. If my understanding is wrong, please provide some additional context and maybe some images of your current flow design.
For this answer, I'm using the following data, which is also organized in an JSON array of objects, where the amounts are represented in strings:
The first step is to create a new variable of float type to store your final sum. Make sure to set its value as zero:
Now you can loop your JSON array (in my case, the "json" variable) and add a Increment variable action within the loop, referencing your float var:
Inside the Increment variable action value, add the following expression: float(item()['Gift Amount']). In this step, we are accessing the Gift Amount property from each of the array elements, converting it into float data type and then adding it to the total amount variable. Since float is a numerical data type, no errors must be raised.
I also included a final Compose, just to print the result of total amount variable after the loop. The result is a sum of all gift amounts, as expected:
I'm also sharing some articles related to the topics discussed here, which can be useful for you or for other users that find this thread in the future:
Let me know if it works for you or if you need any additional help!
-------------------------------------------------------------------------
If this is the answer for your question, please mark the post as Solved.
If this answer helps you in any way, please give it a like.