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 / Check if collection re...
Power Apps
Unanswered

Check if collection record exactly matches a selected item

(0) ShareShare
ReportReport
Posted on by

I know this is simple, but...

 

The below 'exactin'  (or just 'in') statement works fine for checking whether the collection  'Col_GraphElement' contains a selected number within its ID_Number column. 

 

RemoveIf(Col_GraphElement,ID_Number exactin Col_GraphElement.ID_Number)

 

But if I replace 'exactin' with =, I get 'invalid argument type. 

 

This doesn't seem to make sense. How else can I check if the ID exactly matches an existing record in the collection? 

 

Thanks. 

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

    Hi @Anonymous ,

    The reason why you should use 'exactin'  (or  'in') in the first formula is that:

    Col_GraphElement.ID_Number represents a table, while ID_Number is a value.

    You can not compare a value with a table.

    You could only check whether a value is inside the table.

    If you want to find the exactly record, you could try the formula:

    LookUp(Col_GraphElement,ID_Number=selected.ID_Number)

    ID_Number represent a field name inside Col_GraphElement table.

    You could check whether a filed is equal to a value.

    selected.ID_Number represent the selected number , you should replace it with a value.

     

    Please note that when comparing you should use these two types

    1)value in table

    2)field name=value

     

     

    Bets regards,

  • Community Power Platform Member Profile Picture
    on at

    Ok thanks-that makes sense as far as a single value is concerned 🙂 The LookUp() function is ideal for this!

     

    But what if multiple matches might be found? 

     

    Eg:

    Col_Fruit contains a column called Fruit_Name. Fruit_Name contains the following values:


    "Orange"

    "Apple"
    "Apple"

    "Apples"

    "Pear"

     

    Suppose I want to delete all 'Apple' entries. 

    I cannot use the following:

     

     

    RemoveIf(Col_Fruit,"Apple" in Col_Fruit.Fruit_Name)

     

     

    This would remove "Apples" as well as the "Apple" entries. 

     

    I cannot not use 'LookUp' here (as far as I can tell) since multiple records need to be removed.

     

    I think that you explained a solution to this with the following. I just need to understand 2) a bit better. 

     

    <blockquote>

    Please note that when comparing you should use these two types

    1)value in table

    2)field name=value

    </blockquote>

     

    I think I understand 1). "Apple" in Col_Fruit.Fruit_Name would be an example of this. 

     

    But I'm not sure I understand 2). Sorry if this sounds obvious, but how do I identify the field name in PowerApps? (Assuming field_name isn't a reserved keyword, of course)

     

    Using the above example, the field name is whatever is contained for each record. So the field name of "Apple" is "Apple", etc...so the relevant syntax for 'field name = value' would be... "Apple" = "Apple"?

     

    I think I just need some help clarifying this second point (point 2) but otherwise, thanks for the help so far. 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard