cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tictag
Regular Visitor

Microsoft Forms Likert Responses to SharePoint Columns

In a Microsoft Form I need to choose from many attributes ('Statements') to assign to a limited number of individual people ('Choices'), for example 'Shoe Size of Person 1', 'Shoe Size of Person 2' etc. For this I am using a Likert control. Note: Simple Text/Number fields are not an option because of ... reasons.

 

2022-07-17_17-47-30.png

 

My flow triggers on form submission and transfers form data to a SharePoint list (basic template), nothing special.

 

Transferring the choice response to a Likert statement to a SharePoint columns is easy enough, but I need this data to be 'flipped' - I need the chosen attribute ('Statement') to be displayed against the person ('Choice'), the exact opposite of the default behaviour. The UID of the statement is known, together with the choice made in the Get response details output.

 

2022-07-17_17-49-31.png

 

It sounds simple enough but I've been hemorrhaging brain matter on this now for nearly a week! 🤯 I am in need of a bigger brain! 🧠

 

My guess at a solution would be to use JSON data mapping techniques (e.g. variables, arrays, compose etc) to store the correct data inside a variable, then use that variable to populate the SharePoint column in the Create item step.

 

2022-07-17_17-48-02.png

 

In theory there should be only one attribute ('Statement') chosen for each person ('Choice'), for example:  "The Shoe Size of Person 1 is UK12", "The Shoe Size of Person 2 is UK6" etc. As I cannot technically restrict this, any advice on exception handling would be useful.

 

Any help / guidance would be warmly appreciated.

 

David.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @tictag ,

 

You could create a list to store the relationship between the statement field and its value.

vxiaochenmsft_0-1658288108294.png

vxiaochenmsft_1-1658288121052.png

I did a sample for you.

vxiaochenmsft_2-1658288153149.png

[
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 1')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 1')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 2')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 2')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 3')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 3')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 4')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 4')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 5')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 5')),'"')),-3)]}
]

 

vxiaochenmsft_3-1658288198524.png

@{outputs('Get_items')?['body/value']?[0]?['Test']}

 

vxiaochenmsft_4-1658288296444.png

 

Result:

vxiaochenmsft_5-1658288354155.png

vxiaochenmsft_6-1658288365636.png

 

Best Regards,

Wearsky

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @tictag ,

 

You could create a list to store the relationship between the statement field and its value.

vxiaochenmsft_0-1658288108294.png

vxiaochenmsft_1-1658288121052.png

I did a sample for you.

vxiaochenmsft_2-1658288153149.png

[
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 1')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 1')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 2')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 2')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 3')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 3')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 4')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 4')),'"')),-3)]},
@{split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 5')),'"')?[add(length(split(slice(string(outputs('Get_response_details')?['body']),0,indexOf(string(outputs('Get_response_details')?['body']),'Person 5')),'"')),-3)]}
]

 

vxiaochenmsft_3-1658288198524.png

@{outputs('Get_items')?['body/value']?[0]?['Test']}

 

vxiaochenmsft_4-1658288296444.png

 

Result:

vxiaochenmsft_5-1658288354155.png

vxiaochenmsft_6-1658288365636.png

 

Best Regards,

Wearsky

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,650)