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 / Search array values
Power Apps
Unanswered

Search array values

(0) ShareShare
ReportReport
Posted on by

I looking for help with Power Apps

I have collection

ClearCollect(lstIds ,{ code :"11" ,"22" , "33"});
I need to search for specific value in the collection

Filter(varRecord , varRecord.column not in lstIds.code|); //

May be there exists another way to search for a value of column  not in the collection  lstIds

Thanks

 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    Try:

    ClearCollect(lstIds, { code: "11"}, { code: "22" },{ code: "33" },{ code: "44" })

    Or

    ClearCollect(lstIds, { code: 11}, { code: 22 },{ code: 33 },{ code: 44 })

     

    Then filter as:

    Filter(varRecord,Not(code in lstIds. code))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    on at

    Thank you very much !:)

    No,it doesn't work

  • eka24 Profile Picture
    20,923 on at

    Can you show how you got varRecord or the Table used

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    on at

    Sorry that in image .I have problem with keyboard suddenly

  • DevendraSingh Profile Picture
    144 on at

    Hello,

    Your collection should be 

    ClearCollect(lstIds,{code:"11"},{code:"22"},{code:"33"},{code:"44"});

    I don't know the type of the "varRecord" object, so I am assuming that either it is a collection or a variable.

    If "varRecord" is a collection, i.e. ClearCollect(varRecord,{code:"77"},{code:"22"},{code:"33"},{code:"44"});, then write the below formula,

    Filter(varRecord,Not(code in lstIds.code))

    If "varRecord" is a variable, i.e. Set(varRecord,77), then write the below formula,

    Filter(lstIds, code<>varRecord)

     

    Please click Accept as Solution, if this solution solved your issue.

     

    Thanks & Regards,

    Devendra Singh

  • Community Power Platform Member Profile Picture
    on at

    It doesn't accept not first and not second  version 😞

  • eka24 Profile Picture
    20,923 on at

    Am confused because the collection and the variable does not have anything in common from your attached.

     

    The variable you have created being compared using in function to search for in the collection containing numbers cannot work.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    You need to use ForAll function to loop through the varSubject4Id to check whether each value is in lstIds.code, if not, then, save the value to a new collection.

    Please try this:

    Clear(Col1);ForAll(varRecord,If(Not(ColumnName in lstIds.code),Collect(Col1,{Value:ColumnName})))

    Then the Col1 collection is the filtered collection that the value of column is not in the collection  lstIds.

    Hope this helps.

    Sik

  • Community Power Platform Member Profile Picture
    on at

    Thank you very much for your replay !:)

  • Community Power Platform Member Profile Picture
    on at

    thank you very very much ! It works !!!!!!!!!!!!!!!!! :):):)

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard