web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / "in" and "exactin" sti...
Power Apps
Unanswered

"in" and "exactin" still don't work for (new) OptionSetValue

(0) ShareShare
ReportReport
Posted on by 635

Hello

Please be so kind as to read my full post before responding.
Thank you for your consideration.

Since already several versions, "Relational data, options sets, and other new features for CDS", is, by default, turned on.
This changes all option set values to the new OptionSetValue type.
The "in" and "exactin" operators don't seem to be working with this OptionSetValue type.
image.png
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/operators

I want to use this to test if certain values are selected in CDS/Dynamics multiselect option set fields.


To give an example, in CDS, I have a global option set "optionset 01" with options "01.01" through "01.10".
image.png
In PowerApps, single values can be obtained with "'optionset 01'.'01.01'" through "'optionset 01'.'01.10'".
All values can be obtained with "Choices('optionset 01')".
I have set a Label with Text

"Tests:
" & (1 in [1] ) & "
" & (true in [true]) & "
" & ("Test" in ["Test"]) & "
" & ('optionset 01'.'01.01' in Choices('optionset 01')) & "
" & ({Value: 'optionset 01'.'01.01'} in Choices('optionset 01')) & "
" & (!IsEmpty(Filter(Choices('optionset 01'), Value='optionset 01'.'01.01'))) & "
" & ('optionset 01'.'01.01' in ['optionset 01'.'01.01']) & "
" & ({Value: 'optionset 01'.'01.01'} in ['optionset 01'.'01.01']) & "
" & (!IsEmpty(Filter(['optionset 01'.'01.01'], Value='optionset 01'.'01.01')))

This yieldsimage.png

As visible in this screenshot, the "in" operator does not seem to work for the option set values in the same way as for numbers, booleans or strings.
Also, please note the workarounds

({Value: 'optionset 01'.'01.01'} in Choices('optionset 01')) &&
(!IsEmpty(Filter(Choices('optionset 01'), Value='optionset 01'.'01.01')))

which yield the correct result.
Apparently, comparison of option set values with "=" works, and thus, using the "record version of in" or Filter with explicit comparison with "=" both work.

It appears as if the comparison against the column Value of the "Inline value tables", such as also returned by Choices, or used as representation of multiselect option set fields, doesn't yet properly work.
image.png
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-tables

The same applies to the "exactin" operator, see for example another Label with Text

"Tests:
" & (1 exactin [1] ) & "
" & (true exactin [true]) & "
" & ("Test" exactin ["Test"]) & "
" & ('optionset 01'.'01.01' exactin Choices('optionset 01')) & "
" & ({Value: 'optionset 01'.'01.01'} exactin Choices('optionset 01')) & "
" & ('optionset 01'.'01.01' exactin ['optionset 01'.'01.01']) & "
" & ({Value: 'optionset 01'.'01.01'} exactin ['optionset 01'.'01.01'])

image.png

Please see also this earlier post on the same issue:
https://powerusers.microsoft.com/t5/Building-PowerApps-Formerly/quot-in-quot-operator-not-working-for-OptionSetValue-with-quot/m-p/269965


Please note that this post is more a information to fellow PowerApps users and complaint/bug report for the backend team.
I don't need "help".
I do have a workaround.

Last tested with
PowerApps Release: 3.19093.16
App Id: 854c44bd-1067-46f2-a8b8-b4f1aa77dbb1
Session ID: 26a25700-94c4-4bbe-aed4-3c393e08d11e
image.png

Thank you,
     Sa Wu.

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @SaWu ,

    Thanks for your sharing.

     

    Yeah, you are right. The 'in' operator has not been supported to compare a Option Set value with a OptionSetValue result (e.g. Choices('Option Set Name')).

     

    If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

     

    As an alternative solution, I agree with you. I would also share your solution to other users who facing this issue.

     

    Best regards,

  • SaWu Profile Picture
    635 on at

    Hi @v-xida-msft 

    I don't really see why it is necessary to suggest this "feature", which I would have assumed to be natural and currently buggily missing, as an idea, but I did it anyway:
    https://powerusers.microsoft.com/t5/PowerApps-Ideas/Make-quot-in-quot-and-quot-exactin-quot-operators-work-for/idi-p/374057

    Thanks,
        Sa.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard