web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Append multi-choice an...
Power Automate
Unanswered

Append multi-choice answer into individual variables

(0) ShareShare
ReportReport
Posted on by 12

Hi all,

 

I am trying to find a way to append a multi choice MS forms output, then mapping each output to a unique variable that i can use to populate a MS word form.

 

EG: Output// 

"r471129aa16ef4dcdbcdd56d4b7e2863b""[\"Option 1\",\"Option 2\",\"Option 3\"]"
 
Desired outcome
Variable1=Option 1
Variable2=Option 2
 
I can then use these variables to populate the individual word form with the appropriate variable values.


Everything i have tried until now has been to no avail. I can populate the form no problem its just mapping the outputs.

Any help would be massively appreciated.

 

Thanks

Categories:
I have the same question (0)
  • v-zhoqian-msft Profile Picture
    Microsoft Employee on at

    Hi @george-lh ,

     

     

    You can convert the output to an array by the following formula:

    Then get each value by index, such as variables('arrayName')[0].

    split(slice(outputs('Get_response_details')?['body/r471129aa16ef4dcdbcdd56d4b7e2863b'],2,-2),'","')

    vzhoqianmsft_1-1683105048702.png

     

    Test:

    vzhoqianmsft_0-1683104958359.png

     

     

     

    Best Regards,

    Habsburg Qian

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • george-lh Profile Picture
    12 on at

    Deleted response

  • george-lh Profile Picture
    12 on at

    Hi,

    Thanks for your response, the solution works but has got an issue.
    I have created  the following variable expressions to represent the upto 4 options that can be defined for this example.

    variables('test')[0]

    variables('test')[1]

    variables('test')[2]

    variables('test')[3]

     

    If i then test the flow with all 4 answers it works.
    However running a test with 3 or less options selected returns an error 
     

    The template language expression 'variables('test')[3]' cannot be evaluated because array index '3' is outside bounds (0, 2) of array

     

    Due to me mapping these variables to a word form field if I run a test with options 2/3/4 selected, those variable values change so mapping the output gets mixed up.

    What would you suggest with this ?

    Thanks again, George

  • v-zhoqian-msft Profile Picture
    Microsoft Employee on at

    Hi @george-lh ,

     

    Has the issue been resolved? I think you can create an array containing all the answers first, then compare this array with the outcome array, and set the non-existing items to null.

     

     

     

     

     

     

     

    Best Regards,

    Habsburg Qian

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • george-lh Profile Picture
    12 on at

    HI, Its not resolved as of yet.
    Do you have an example of this at all? Power-automate is pretty new to me so not quite up to speed yet.

     

    Regards
    George

  • v-zhoqian-msft Profile Picture
    Microsoft Employee on at

      

  • george-lh Profile Picture
    12 on at

    Hi, not sure if you noticed you posted a blank response.

    Kind regards
    George

  • Verified answer
    v-zhoqian-msft Profile Picture
    Microsoft Employee on at

    Hi @george-lh ,

     

     

    If you have not yet resolved the issue, you could refer to the following method:

    Array 'arr' remains unchanged,

    Set the array 'answers' to include all answers,

    The array 'result' is what we want.

    In this example, the unselected answer will be displayed as "null".

     

    vzhoqianmsft_0-1684313486803.png

    vzhoqianmsft_1-1684313716850.png

    vzhoqianmsft_3-1684313786878.png

     

    Test:

    vzhoqianmsft_4-1684314156085.png

    vzhoqianmsft_6-1684314195330.png

     

     

     

     

     

     

     

    Best Regards,

    Habsburg Qian

    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

     

  • george-lh Profile Picture
    12 on at

    Hi all,

    Just wanted to revisit this as i have been trying to utilise multi option with a other field.
    Due to not being able to define the random value other can be, i have tried to append a variable value, then append with actual value after its ran, however i can get it to play nicely.

    Could anyone help at all?

    Thanks
    George

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard