cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aleenav
Helper I
Helper I

Search array values

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @aleenav ,

 

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

View solution in original post

10 REPLIES 10
eka24
Super User
Super User

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.

Thank you very much !:)

No,it doesn't work

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.

Sorry that in image .I have problem with keyboard suddenly

DevendraSingh
Resolver I
Resolver I

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

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

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.

v-siky-msft
Community Support
Community Support

Hi @aleenav ,

 

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

View solution in original post

Thank you very much for your replay !:)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,074)