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

Power apps cannot convert text to an Option set value in Canvas Apps

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 combo box shows the Option set 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 option set text and values. We need to get the keys of the selected options in that combo box control. We have retrieved the selected option set texts into a collection. Now that we have two collections (one with all the possible Option set texts and values) and another collection which contains the selected options 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Chandanajcp ,

 

Is it a replicated thread? Whatever, I post my answer again.

 

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 

View solution in original post

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @Chandanajcp ,

 

Is it a replicated thread? Whatever, I post my answer again.

 

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

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (6,507)