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

common data service, store form result as label

Hi,

 

I have a flow gathering answers from a form.

I want to store one of the results in common data services but I want to use the label of an optionset.
So, the optionset contains "AnswerA"  , "AnswerB" or "AnswerC" , the result of the form is "AnswerB"

When I want to store that in CDS (create new record) , it does not work (it expects the right ID of the optionset label)
It does work when I use the Dynamics Connector but since that one does not support service principal, I want to go for the Common data services (current environment) one.

Anya ideas ?

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @Vinisz ,

 

You could create an array to create the relationship between the answer option in the response and the label value of an option set. Like:

[{
"Answer":"AnswerA",
"Label":5
},
{
"Answer":"AnswerB",
"Label":6
},
{
"Answer":"AnswerC",
"Label":7
}]

After a user submits a response, you can filter out the label value from the array based on the answer, and then use this label to create the record.

Image reference:

Spoiler
154.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Solution Sage
Solution Sage

Hi @Vinisz ,

 

Following url might help if you are looking to get optionset value based on label:

 

https://www.c-sharpcorner.com/article/get-option-set-value-based-on-label-in-microsoft-flow/

 

Thanks

Well, not really.
I need to create a new record with the right option value/label , not retrieve the value or the label, I know how to do that.
It should look like this I think:

 

1)String entered in the form is "Answer C"

2)Query CDS optionset for "Answer C" (search on the label) and retrieve the option value matching it (5 for example)

3)Create a new CDS record, now we now that "5" is the right value , insert this

 

Hi @Vinisz ,

 

You could create an array to create the relationship between the answer option in the response and the label value of an option set. Like:

[{
"Answer":"AnswerA",
"Label":5
},
{
"Answer":"AnswerB",
"Label":6
},
{
"Answer":"AnswerC",
"Label":7
}]

After a user submits a response, you can filter out the label value from the array based on the answer, and then use this label to create the record.

Image reference:

Spoiler
154.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Kudo Commander
Kudo Commander

@Vinisz 

 

With the latest update of Common Data Service (current environment) connector, you can now query the formatted values of supported field types such as lookup display name, option set value label, formatted date/time by using the OData.Community.Display.V1.FormattedValue property of the field in the expression.

 

https://linnzawwin.blogspot.com/2020/07/get-lookup-display-name-and-option-set.html

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (11,139)