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 Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,111)