cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Robin1988
Helper III
Helper III

A response from MS Forms to a choice(s) column in dataverse

I'm struggling whole day with in my opion a very simple action. I just want the answer of a MS Forms multi select check box in a dataverse choices column. A choice single select also no working. I've tried a lot with the explaining video's online but all are related to Sharepoint. Maybe Dataverse is different I can't figure out what to do to make this work. I tried the replace replace replace or join till its like :  answer 1, awnser2, awnser3  (not working  so far)

 

Please anyone? 🙂 

 

I have a screenshot of only one I tried. 

 

 

Picture1.png

1 ACCEPTED SOLUTION

Accepted Solutions
takolota
Super User
Super User

I have to enter possible multiple choice meal time options in to my Dataverse table and I just use the following expression to create my string of numbers matching the choices:

replace(trim(concat(if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Breakfast'),'759090000 ',''), if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Lunch'),'759090001 ',''), if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Dinner'),'759090002 ',''))), ' '',')
 
The field is mandatory so I don't have to worry about null values in a replace function, but even if it wasn't mandatory I would just use a if(empty(InsertOutput), '', Replace(InsertOtherFunctions))
to avoid the null values in replace function issues.
 
All the integer values are available if you go to the table, go to the choices column you are using, go to edit choices, click the three dots ... and select view more.
takolota_0-1645317450491.png

 

 

takolota_1-1645317450520.png

 

View solution in original post

12 REPLIES 12
Robin1988
Helper III
Helper III

Morning @Pstork1 here I made a new post, hope you have a few minutes to help me out.

In this last example my dynamic content output of select not showing up.

takolota
Super User
Super User

I have to enter possible multiple choice meal time options in to my Dataverse table and I just use the following expression to create my string of numbers matching the choices:

replace(trim(concat(if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Breakfast'),'759090000 ',''), if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Lunch'),'759090001 ',''), if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Dinner'),'759090002 ',''))), ' '',')
 
The field is mandatory so I don't have to worry about null values in a replace function, but even if it wasn't mandatory I would just use a if(empty(InsertOutput), '', Replace(InsertOtherFunctions))
to avoid the null values in replace function issues.
 
All the integer values are available if you go to the table, go to the choices column you are using, go to edit choices, click the three dots ... and select view more.
takolota_0-1645317450491.png

 

 

takolota_1-1645317450520.png

 

Robin1988
Helper III
Helper III

Thx @takolota I had it already found out by my self. But this does the trick 🙂 

Yeah I was working on this yesterday, went to the forums to see if there was a quick solution, and only found a single post involving xml and thought “How could no one have posted a simpler answer to this yet?”

Robin1988
Helper III
Helper III

Don't know! I was wondering the same. Even MS Support wasn't able to give me an right answer. I thought lots of people need this.

 

 

Now I use the value number more often, works perfect in lookups fields to.

Hey Robin!

 

I am having this same issue and was wondering if you could show photos of your compose and select action expressions for further detail? 

 

I would greatly appreciate it!

 

Thanks,

 

Dillion

 

 

Hi @dcastillo1 it's more easy then you think.

 

First find the value you need in Dataverse by open up the settings of the choices column. See above.
Then just replace the awnser form MS Form with the value and paste the output there where you want to update Dataverse.

Compose expression:

replace(replace(outputs('Get_response_details_2')?['body/r2a955ff793174deba029cbce4d68a039'],'Option 1','614100000'),'Option 2','614100001')

 

Robin1988_0-1657877158656.png

 

Thank you so much! This worked BUT it only worked for the first 3 choices of my choice field. I have 8 total. 

 

This is what is working so far: 

replace(replace(replace(outputs('Get_response_details')?['body/rd5117fcd2654411ba82921c030ffd4c9'],'Sole Proprietorship','124270000'),'Partnership','124270001'),'S Corporation','124270002')
 
dcastillo1_0-1657944446582.png

 

This is what I need to work: replace(replace(replace(outputs('Get_response_details')?['body/rd5117fcd2654411ba82921c030ffd4c9'],'Sole Proprietorship','124270000'),'Partnership','124270001'),'S Corporation','124270002'),'C Corporation','124270003'),'LLC Taxed as a Disregarded Entity','124270004'),'LLC Taxed as a Partnership','124270005'),'LLC taxed as an S Corporation','124270006'),'LLC Taxed as a C Corporation','124270007'),'Other','124270008')

 

For each put a replace in front:

 

replace(replace(replace(replace(replace(replace(outputs('Get_response_details')?['body/rd5117fcd2654411ba82921c030ffd4c9'],'Sole Proprietorship','124270000'),'Partnership','124270001'),'S Corporation','124270002'),'C Corporation','124270003'),'LLC Taxed as a Disregarded Entity','124270004'),'LLC Taxed as a Partnership','124270005'),'LLC taxed as an S Corporation','124270006'),'LLC Taxed as a C Corporation','124270007'),'Other','124270008')

 

 

Accept as Solution if it works 🙂

Awesome! Thanks Robin.

 

So 'Sole Proprietorship','124270000'),'Partnership','124270001'),'S Corporation','124270002'),'C Corporation','124270003'),'LLC Taxed as a Disregarded Entity', and the last choice Other','124270008' work perfectly and the text is replaced with the integer correctly.

 

All other options that have a string that has been used in a prior choice are failing. The compose output looks like so :

dcastillo1_0-1658115334902.png

The replace function is getting confused. How can I avoid this?

 

This is how it should look. This is the flow working when I choose the "other" option on the form. 

dcastillo1_1-1658115464909.png

I appreciate all the help!

Robin1988
Helper III
Helper III

@dcastillo1 sorry I missed the notification, did you allready solve this problem?

No problem but I did not. Any thoughts?

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,582)