Hi all, having a real headache with this. At first, I was pulling the summed up value down from the spreadsheet generated by MS Forms (I added in a calculation column), but flow keeps spitting out that column as a 0 value on the first run (fine if I rerun it) and it's the same no matter what I do.
With no other option, I need to make the flow calculate the value and I'm pretty new to coding. Everything I'm finding on the subject of adding more than two things seems to draw down from a sharepoint list as a data source, which isn't an option in this case.
I've created an array from those MS Form values in the Compose function like so:
createArray(
outputs('Get_response_details')?['body/r54d2e838f4704b85869d7be3d84c9817'],
outputs('Get_response_details')?['body/ra492c3687e654148a96bd3c5665b4b5e'],
outputs('Get_response_details')?['body/r365199281e074c39825df8766863d86f'],
outputs('Get_response_details')?['body/r64ab68838da84c1095220deea13e9d30'],
outputs('Get_response_details')?['body/ra5241b87c1784045b3f5c8f61e8562f0'])
I then put in two two 'initialise variables' as float, then an apply to each stage to loop round the values.
The first set variable uses the following:
add(items('Apply_to_each'),variable('finalTotal'))
The output message I got was that it would only work with an integer or number, so I inserted another Compose function that put an integer around this output as it didn't like it directly, which should have been my first clue it wouldn't work, it said it couldn't be converted to the target type:
int(outputs('Array_for_costs'))
I'm a bit at a loss here. How can I sum up my 5 array values? Any insight would be very much appreciated.
Solved! Go to Solution.
It wasn't an option in this case, as we were using MS Forms rather than the Sharepoint List form. But I've managed to solve it really inelegantly anyway.
I had to make each individual input an integer, then add together in 4 stages. Put it in a Scope control for neatness. 😅
Have you tried making a SharePoint list for the data, and then running the values from the form directly in to that, and then working from there?
It wasn't an option in this case, as we were using MS Forms rather than the Sharepoint List form. But I've managed to solve it really inelegantly anyway.
I had to make each individual input an integer, then add together in 4 stages. Put it in a Scope control for neatness. 😅
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
27 | |
20 | |
10 |