Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

PowerApps cannot convert Text to an OptionSetValue.

Like (0) ShareShare
ReportReport
Posted on 24 Jun 2020 15:42:33 by

We have a Canvas app where there is a combo box control which corresponds to Multi Select Option Set in Dynamics 365. In order to populate combo box we have filtered the data source of Dynamics 365 entities which uses CDS Current Environment Connector. 

 

Now, the combobox shows the Optionset text and i think there is no possibility to retrieve the option set values from Dynamics 365.

So, I have created a collection which holds all the optionset text and values named "All Items". We need to get the keys of the selected options in that combo box control. We have retrieved the selected optionset texts into a collection named "SelectedOptions". Now that we have two collections (one with all the possible Optionset texts and values - "All Items") and another collection which contains the selected options (SelectedOptions).

 

Requirement is to create a new collection which has two columns for Optionset text and optionset value of the Selected options in the combo box, Below formula is used to do that.

All Items:

OptionsettextOptionsetvalue
Product1

1

Product22
Product33
 

SelectedOptions:

Options

Product1
Product3

 

NewCollection - Desired Output:

OptionsettextOptionsetvalue
Product1

1

Product33

 

ClearCollect(NewCollection, Filter(AllItems, Optionsettext  in SelectedOptions.Options)) - This works when i use Dynamics 365 connector but gives an error on Optionsettext which says "Powerapps cannot convert text to an Optionset value".

 

Please suggest.

Categories:
  • Verified answer
    v-siky-msft Profile Picture
    on 25 Jun 2020 at 03:38:25
    Re: PowerApps cannot convert Text to an OptionSetValue.

    Hi @Anonymous ,

     

    Here is a easy solution, add a new column to store the option text in SelectedOptions Collection, and then filter by that column.

    1.Create a new Collection with the OptionsText column

    ClearCollect(SelectedOptionsText, AddColumns(SelectedOptions, "OptionsText", Text(Options)))

    2. Filter based on the new collection.

    ClearCollect(NewCollection, Filter(AllItems, Optionsettext in SelectedOptionsText.OptionsText))

    Hope this helps.

    Sik 

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Loading complete