Hi @niteshdambale ,
Could you please share a bit more about your scenario?
Do you want to set a text value back to a OptionSet type field in your CDS Entity from your app?
If you want to set a text value back to a OptionSet type field in your CDS Entity from your app, I afraid that there is no way to achieve your needs in PowerApps currently.
The 'Option Set' field in CDS Entity is required to provide Option Set type value only, you could not assign a Text value back to Option Set field.
As an alternative solution, I think the If function could achieve your needs. You could consider patch corresponding Option Set option value back to the Option Set field based on the Text variable value.
I assume that you want to use Patch function to patch data back to the Option Set field, please take a try with the following formula:
Patch(
'CDSEntity',
Defaults('CDSEntity'),
{
...,
OptionSetColumn: If(
TextVariable = "value1", /* <-- TextVariable represents the text variable that you set using UpdateContext function */
OptionSetName.Option1, /* <-- OptionSetName represents the name of your Option Set type, which binds to your OptionSetColumn*/
TextVariable = "value2",
OptionSetName.Option2,
TextVariable = "value3",
OptionSetName.Option3,
...
)
}
)
If you use Edit form to submit your data, please set the Update property of the Option Set field data card in your Edit form to following:
If(
TextVariable = "value1", /* <-- TextVariable represents the text variable that you set using UpdateContext function */
OptionSetName.Option1, /* <-- OptionSetName represents the name of your Option Set type, which binds to your OptionSetColumn*/
TextVariable = "value2",
OptionSetName.Option2,
TextVariable = "value3",
OptionSetName.Option3,
...
)
Please consider take a try with above alternative solution, then check if the issue is solved.
Best regards,