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 / Load item of gallery w...
Power Apps
Unanswered

Load item of gallery when screen is opened

(0) ShareShare
ReportReport
Posted on by 38

Hi, I am new to power apps and I tried to find the solution to this, but I didnt...

When a new screen is opened, the items in my gallery 1 is loaded, but I also want to load at the same time, the gallery 2 with the information from the First item of the gallery 1... (they are connected by ids on the dataverse)... idk where I could put the "set variable" on, 

 

aldirjr_2-1694146311582.pngaldirjr_1-1694146186137.png

 

(basically each item of Gallery 1, has different question that are going to be shown to Gallery 2, so when the screen is loaded, I want to load the questions of the G 1 "Environment"...

 

More info (if needed):


Codes in the Gallery with the sections (G1)
Data-> 'Questionnaire Area Divisions'

 

G2 should be something like: 

Data -> Filter('Questions', 'Questionnaire Area Division'.Name exactin LookUp('Questionnaire Area Divisions', Name exactin G1.FirstItem.Name).Name)

? or maybe i have to do this on the OnVisible, for the screen?

 

Thank you!!

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @aldirjr 

     

    To achieve this in Power Apps, you can set the variable on the OnSelect property of the item in Gallery 1. When an item in Gallery 1 is selected, you can set a variable to the selected item's information, and then use this variable to filter and load Gallery 2 with the related questions.

    You can follow the following steps:

     

    1. In Gallery 1, select the item for which you want to load questions in Gallery 2.

    2. In the OnSelect property of the selected item in Gallery 1, set a variable to the selected item's information. For example, you can use the Set function: Set(SelectedQuestionnaire, ThisItem)

    3. In Gallery 2, set the Items property to filter the questions based on the selected item in Gallery 1. You can use the Filter function for this purpose: Filter('Questions', 'Questionnaire Area Division'.Name = SelectedQuestionnaire.Name)

     

    Here, 'Questions' is the data source for Gallery 2, and 'Questionnaire Area Division'.Name is the common field between 'Questions' and 'Questionnaire Area Divisions'.

    Make sure that Gallery 2 is set to display the filtered questions correctly in its template.

    With these steps, when you select an item in Gallery 1, it will set the SelectedQuestionaire variable, and Gallery 2 will be filtered and loaded with the related questions based on the selected item's information.

    You don't necessarily need to use the OnVisible property of the screen for this purpose; setting the variable when an item is selected in Gallery 1 is a more user-friendly approach.

     

     

    I hope this helps 🙂

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard