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 / filtering gallery usin...
Power Apps
Unanswered

filtering gallery using global variable

(0) ShareShare
ReportReport
Posted on by 6

I created  a tabbed gallery and have a sharepoint list,  Similar to the  video https://www.youtube.com/watch?v=if_mFIfi5PM

I added a global variable on the home page, which I pass on to the tabbed gallery. I want the tabbed gallery to show records that match the global version number .

 

However I am not sure how to compare the value of the global variable against the table data that is loaded in the gallery.

 

Home page 

I set the global variable and pass it on the different pages 

         Set(Gversion,Dropdownversion.SelectedText); Navigate(tdlcGenerator,ScreenTransition.None)

 

In my Questions gallery page,   my gallery displays data 

This works  and shows all the data 

  SortByColumns(Filter('TQtable',qSearchText.Text in Question),"DisplayOrder",Ascending)

 

I tried the following so I can filter on the global version variable that I pass to this page , the following do not work. Note that I can see the value of the global variable 

 

  SortByColumns(Filter('TQtable',qSearchText.Text in Question,'TQtable'.tdlcVersion in Gversion.Value),"DisplayOrder",Ascending)

 

hard cording did not work either 

If ('TQtable'.tdlcVersion in 4,SortByColumns(Filter('TQtable',qSearchText.Text in Question),"DisplayOrder",Ascending))

 

If ('TQtable'.tdlcVersion in Gversion.Value,SortByColumns(Filter('TQtable',qSearchText.Text in Question),"DisplayOrder",Ascending))

 

thanks and appreciate the help 

Categories:
I have the same question (0)
  • LRVinNC Profile Picture
    2,297 on at

    I see a couple things. 

     

    First, on your hardcoded test, use = not in.  If tdlcVersion is numeric, then testing for = 4 is fine.  If it is a text value, you'll need to put the 4 in quotes (= "4").

     

    If ('TQtable'.tdlcVersion = 4,SortByColumns(Filter('TQtable',qSearchText.Text in Question),"DisplayOrder",Ascending))

     

    Then on your desired statement, you want to structure your query the same way using = rather than in.  Also, when using a global variable, you don't need to use .Value, just use the name of the Global Variable.  

     

    SortByColumns(Filter('TQtable',qSearchText.Text in Question,'TQtable'.tdlcVersion = Gversion),"DisplayOrder",Ascending)

     

    See if these get you farther.  

  • powerW Profile Picture
    6 on at

    thanks for helping but I tried both the recommended options and it shows no data 

    I do have records with version 4 

     

    If ('TQtable'.tdlcVersion = 4,SortByColumns(Filter('TQtable',qSearchText.Text in Question),"DisplayOrder",Ascending))

    or 

    SortByColumns(Filter('TQtable',qSearchText.Text in Question,'TQtable'.tdlcVersion = Gversion),"DisplayOrder",Ascending)

     

  • LRVinNC Profile Picture
    2,297 on at

    What is the data type of tdlcVersion?

  • powerW Profile Picture
    6 on at

    numeric

  • LRVinNC Profile Picture
    2,297 on at

    Try testing with this to see if it returns the right records.

     

    SortByColumns(Filter('TQtable',qSearchText.Text in Question,'TQtable'.tdlcVersion = 4),"DisplayOrder",Ascending)

  • powerW Profile Picture
    6 on at

    no 

    I even added a new column to the table called tdlcversions and made it a data type 

     

    SortByColumns(Filter('TQtable',qSearchText.Text in Question,'TQtable'.tdlcVersions in "4"),"DisplayOrder",Ascending)

     

    I was hoping this would display version 4 

     

     

  • LRVinNC Profile Picture
    2,297 on at

    Don't use "in" for your version comparison.  Use =.  

    And you know the search text you are using exists for version 4, correct?

    You may want to temporarily remove the search text portion of the filter so you are ONLY filtering on version to get that working right first and then add the search text portion back.  

     

    Simplify temporarily to just:
    Filter('TQtable'.tdlcVersions = 4), if tdlcVersion is still numeric 
    or

    Filter('TQtable'.tdlcVersions = "4"), if tdlcVersion is a text column

     

    What is your data source?  Sharepoint?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard