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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter with the same p...
Power Apps
Answered

Filter with the same property names, ThisRecord not respected

(0) ShareShare
ReportReport
Posted on by 234

This code fails:

 

 

Collect(colTickets, Filter(colSqlSiteVisitsTickets, ThisRecord.svID = svID));

 

 

Workaround 1:

 

With({SiteVisitID: svID},
 Collect(colTickets, Filter(colSqlSiteVisitsTickets, svID = SiteVisitID))
);

 

Workaround 2:

 

UpdateContext({SiteVisitID: svID});
Collect(colTickets, Filter(colSqlSiteVisitsTickets, ThisRecord.svID = SiteVisitID));

 

 

I was expecting that using "ThisRecord" would point to the record in the "Filter" at question and PowerApps would know the other property was not from within the collection, but this is not the case.

 

Is there a better way of doing this instead of using one of the workarounds? 

Categories:
  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @DarkLiteOne 

    Assuming that svID is a variable, the syntax to fully qualify a variable would look like [@VariableName].

    Therefore, this should work for you.

    Collect(colTickets, Filter(colSqlSiteVisitsTickets, svID = [@svID]))

     

  • DarkLiteOne Profile Picture
    234 on at

    Thank you for the suggestion but it yields an error:

    DarkLiteOne_0-1626347325385.png

    Of note is that we pass the variable from another screen like this:

     

    Navigate(DetailsScreen,ScreenTransition.Cover, Parent.Selected);

     

    So I guess it doesn't really qualify as a full variable that can be addressed with "[@myVar]".

     

    Is there another way to address this type of variable?

  • KvB1 Profile Picture
    1,596 on at

    What control contains the variable that you use as a filter?

  • DarkLiteOne Profile Picture
    234 on at

    The variable is coming from another screen and passed in like this:

    Navigate(DetailsScreen,ScreenTransition.Cover, Parent.Selected);

     So on the next screen we can just use the properties, like "svID" and others. They all come from the "Parent.Selected".

  • Verified answer
    timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @DarkLiteOne 

    With this type of situation, I would always pass local context variables as named records. On the main gallery screen, you would use this syntax.

    Navigate(DetailsScreen,
     ScreenTransition.Cover, 
     {locSelectedRecord:Parent.Selected}
    );

     

    On your DetailsScreen, you can then use this syntax to avoid any naming conflicts.

    Collect(colTickets, 
     Filter(colSqlSiteVisitsTickets, svID = locSelectedRecord.svID)
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard