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

Dataverse Optionset - Filter gallery by text variable equals to Dataverse Choice Column

Hi, 

I need to filter a gallery by a Dataverse choice column 'Assign FW to' when their option set 'AssignTo_Choices' is equal to varMyRole.

 

On Start:

Set(varUserName, Office365Users.MyProfile().DisplayName);
Set(varMyRole, LookUp(EO_Users, 'User Name'=varUserName).Role);

 

Gallery Items

Filter(EO_Main, 'Assign FW to' in Choices(AssignTo_Choices), Text(Value) = varMyRole)

 

Error message:

Incompatible types for comparison. These types can´t be compares:

OPtionSetValue(AssignTo_Choices), Record.

 

 

Thanks in advance for any help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
dpoggemann
Super User
Super User

hi @acepeda ,

 

Are you using two different Choice definitions for these or is it a global choice that is shared by both?  Looks like you might have two different ones?

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

View solution in original post

4 REPLIES 4
dpoggemann
Super User
Super User

Hi @acepeda ,

 

Have you tried to utilize the actual values from the Choice to do the filter instead of converting to Text?

 

Something like this:

 

Filter(EO_Main, 'Assign FW to' = varMyRole)

 

This is assuming that the 'Assign FW to' and the varMyRole are of the same Choice type...

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

HI Drew,

 

Thanks for your answer.   I modify the filter according your suggestion and indeed both are OptionSet as shown in the attached image :

 

acepeda_0-1655564017430.png

 

dpoggemann
Super User
Super User

hi @acepeda ,

 

Are you using two different Choice definitions for these or is it a global choice that is shared by both?  Looks like you might have two different ones?

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

i have using 2 different choice definitions.  Now i changed for the same one for both comparison sides and it works.

 

Anyway.. there should be a way to implemented for comparing 2 different option set.

 

 

Thanks.

Helpful resources

Announcements
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.

Users online (5,893)