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 / How to filter gallery ...
Power Apps
Answered

How to filter gallery base on a value from another screen?

(0) ShareShare
ReportReport
Posted on by 12

I would like a gallery to filter and display only items that 'Job Position' Column (data/value) = to a value from a DataCardValue

 

Screen 1 is an edit form, with DataCard "Position Title"

When user click the button "proceed to Candidate Selection"

I set the DataCardValue6 (which is "job post one" in this case) as a global variable "VarPositionTitle"

 

Rantofu_2-1719510118170.png

 

Screen 2 "Candidate Selection" Screen has a gallery

I want to filter the gallery to only show item that the variable "DataCardValue6" (VarPositionTitle) is equal to the Column "Job Position" from "Test Job apply applicant" list

Rantofu_3-1719511850519.png

 

What is is correct code?

 

Or is my approach even correct? If not please let me know how to do it

 

Thank 

 

I have very limited knowledge to coding : (

 

 

Categories:
  • Verified answer
    AmínAA Profile Picture
    1,228 Moderator on at

    Greetings @Rantofu!

     

    Well, first of all, you don't really need to set up a variable for that, since you can reference any field from anywhere on the App, however just to keep going with the same Idea you have, here's what I would do to fix your situation!

     

    OnSelect property of Datacard

    Set(varName, 'DataCardValue of the choosen field'.Text)

     

     

    Items property of gallery

    Filter(
     'YOUR DATASOURCE NAME';
     'COLUMN NAME OF YOUR DATASOURCE' = Text('varName')
    )

     

     

    Something like this should be good enough as far as I'm concerned, unless I made any syntax error!

     

    Hopefully that helped you out, otherwise feel free to reply!

  • Rantofu Profile Picture
    12 on at

    Thanks for the help,

    But I am still getting error 

    Rantofu_0-1719515843575.png

     

    For setting the variable, I did it on the "Proceed to Candidate Selection" Button, do you mean change to the DataCardValue6?

     

    The Value (Text) of DataCardValue 6 will be different (base on previous user selection)

     

     

     

     

  • Rantofu Profile Picture
    12 on at

    I got it.

     
    The correct code is 
     
    Filter('Test Job apply applicant','Job Position'= Text(VarPositionTitle))
    With setting the variable to DataCardValue6.Text
     
    Thank you
  • AmínAA Profile Picture
    1,228 Moderator on at

    Hi there @Rantofu!

     

    So, then did this got solved for you? If that's the case then feel free to mark my previous reply as answer and I'm glad I could be of help, otherwise feel free to reply to this post!

  • Rantofu Profile Picture
    12 on at

    Hi @AmínAA 

    There was error on your 1st reply. But still helped me figured out the solution.

    You can copy paste and post the below code, then I will mark that answer

    I just want to make sure there is no error :)

     

    OnSelect property of the button 

     

     

    Set(varName, DataCardValue of the choosen field.Text)

     

     

     

    Items property of gallery

     

     

    Filter(
     'YOUR DATASOURCE NAME';
     'COLUMN NAME OF YOUR DATASOURCE' = text(varName)
    )

     

     

     

  • AmínAA Profile Picture
    1,228 Moderator on at

    Hi there @Rantofu!

     

    Well your fix and mine are pretty much the same, but I use (;) to separate arguments instead of (,) since I'm from spain, also it shouldn't be necessary to add the Text() function to the varName since by default, unless your datacardvalue holds anything that's not directly any other data type other than string, it will typically return a string. However I made the changes for you, and others, just in case!

     

    Glad that I could be of any help, best regards!

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 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard