Do this.
I created a form with a multi choice that looks like this. I want dad to be 5 points, mom 10 and partner 15
1. Trigger
2. Get response detail
3. create an INT variable and set it to 0
4. Create an Options Array variable and add this express
However, please change the body/rd3xxxx to YOUR dynamic property on your form
You have to change the STRING that gets passed in for your multi-choice (just like mine) to an actual array. Its not an array right now
Initially it looks like this when it comes in
["Dad","Mom"]
We need to do 4 things
1. replace the [ with an empty string
2. replace ] with an empty string
3. replace "" with empty string
4. then SPLIT the final part which looks like
Dad,Mom by the , and make it an array in the Initialiaze array action below
split(
replace(
replace(
replace(outputs('Get_response_details')?['body/rd377696685054b2e953b800c210ba38c'],
'[','')
,']','')
, '"', '')
,',')
Now its time for our switch which is INside our Loop, which is looping on the Options array variable from the top
Then I just have an increment variable inside each case.
And then I have an ending compose JUST to show the value
Now when I run it and Select Mom and Dad from my Form I should get 15 points total
And I do