Skip to main content

Notifications

Power Pages - General Discussions
Answered

Using the IN operator

(0) ShareShare
ReportReport
Posted on by 90
This should be easy:
1. I have a combobox where users can select several states.
2. From this combobox I use this code:
Set(SelEmailStates,Concat(ComboBox1.SelectedItem,'StateAbbreviation' & ","));
3. That instruction generates a string: "AK,AZ"
4. I want to use this to filter a SP list:
Filter(zWPB_State_Contacts,state in varSelEmailStates)
 
The "in" is underlined and I get a delegation warning but it's also not finding any records. 
 
Any insight would be appreciated.
 
Carter
 
 
Categories:
  • disappointed Profile Picture
    disappointed 90 on at
    Using the IN operator

    Thank you, SaiRT14.

    You put me on the right track for something that worked. Putting the items to be matched in a collection was spot on. A little tweeking on the search also worked. 

    Carter

  • Verified answer
    SaiRT14 Profile Picture
    SaiRT14 1,931 on at
    Using the IN operator
    Checkout following way:
     
    ClearCollect(SelEmailStatesCollection, ComboBox1.SelectedItems)
     
    Filter(zWPB_State_Contacts, StateAbbreviation in SelEmailStatesCollection)
     
    Filter(zWPB_State_Contacts, 
      ForAll(SelEmailStatesCollection, StateAbbreviation = SelEmailStatesCollection[@StateAbbreviation])
    )
     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard