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 / Navigate to new Galler...
Power Apps
Unanswered

Navigate to new Gallery and show only those child records from ThisItem

(0) ShareShare
ReportReport
Posted on by 377

Hi there

 

I have a gallery showing items from a SP list.  I would like to click on the selected Item and then navigate to a new gallery to show all child records of that selected item in a new Gallery.  Not sure where to start. 

 

I have Gallery1 showing Students and I can navigate to gallery2 showing reports for all students.  I can filter this gallery to see reports for just one student via a dropdown, however  I would like to filter by the report gallery by the student when I click on see reports on their gallery1 item.

 

If someone could please point me in the right direction I would appreciate it.

 

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

    Every SP record has a unique ID.  When you create the child record,  have it store the master ID in a Column for it.  I do this by have a column in the child and then when I create a new child record,  I capture the master ID somehow in a variable and I make this the default for the field and then hide it so user does not know.

     

    Then when navigating to a child from a parent you set a variable at that time to the ID and do the child galley filter based on that

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @StuCundy ,

    Do you want to filter list2 based on selected item in list1?

    Could you tell me:

    1)these two lists' relationship?

    2)the student field's data type in list1 and list2?

    I assume that :

    1)in list1, you have a student field (data type: text)

    2)in list2, you have a student field(data type: lookup field ,related to the student field in list1)

    If so, try this:

    1)gallery1's Items:

    list1

    2)gallery2's Items:

    Filter(list2,student.Value=Gallery1.Selected.student)

    Then gallery2 will only display the reports based on the selected student.

     

     

     

    Best regards,

  • StuCundy Profile Picture
    377 on at

    Hi Guys @v-yutliu-msft @leyburn19 

     

    Yes I have now got the child gallery functioning by using 

    Filter(StudentReport, StudentID=StudentListBrowseGallery.Selected.ID)

    I now wish to create a new record with the same  StudentID would I enter that in the new form creation function below somehow? 

     

    NewForm(StudentReportEditForm);Navigate(StudentReportEditScreen, ScreenTransition.None)

     

  • leyburn19 Profile Picture
    2,157 on at

    What I do is have one Form that is for view, edit and new.  This means I need to select the student name from the gallery.  When selecting I set a variable with the ID.  In your case you now have a list of many matching records.  I then have a + on that view to create a new record.  So when this is clicked and the form is in new mode,  I get all the relevant fields to do data input.  I make sure the ID filed that this all matches back to the master is one of the Fields on the form.  I set the default for this field to be the variable not parent.default.  It makes no difference if the form is in edit mode as the variable is always the same.  I then hide that field.  When the form is submitted that field store the number you need to match

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @StuCundy ,

    If you want to create a new record by using the selected id, you just need to set the stduent id textinput(inside the edit form)'s Default to:

    StudentListBrowseGallery.Selected.ID

     

     

    Best regards, 

  • StuCundy Profile Picture
    377 on at

    Hi @v-yutliu-msft 

     

    I will go down this track first.  So I have the Student gallery.  I use the following to get the selected items in the report gallery

    Filter(StudentReport,StudentTitle=StudentListBrowseGallery.Selected.Title)

    So my connector with the student list is to select the "Title" from within the Student Report form using a Lookup dropdown.  "StudentTitle" in the Report form.  I do populate the studentID with a lookup too on the report form using

    I do get a list of all the reports relating to that student.

    When I go to view  the report its good but its says connect to data, like its lost the connector.

    noconnect.png

     

    Also when I click to Edit Its a different report.  I know its all to do with the Title=StudentTitle connection but I'm puzzled.

    My Edit button OnSelect is "EditForm(StudentReportEditForm);Navigate(StudentReportEditScreen, ScreenTransition.None)"

     

     

  • leyburn19 Profile Picture
    2,157 on at

    What at are the properties on the Form.

     

    datasource = SPList

    Items = Lookup(SPList,Titel=StudentTitle)

     

    Also what is stored in the Title Column?  You can be in danger of duplicates as student can have same names,  particularly surname.  I would also be concerned with the 2000 records limit.  It is feasible that a unique name will be entered that is not picked up in the maximum 2000. Using unique numeric ID caters for every possibility

  • StuCundy Profile Picture
    377 on at

    Hi @leyburn19 

     

    I'm currently working through this video from Laura Rogers so things are starting to make sense kind of. https://jobs.collab365.community/powerapps-and-related-lists/#4

     

    So I know I can use ID in the student list for the unique name however I have used the Title as a populated combination of names and ID e.g "Name_ID##"

     

    Not worried about the delegation issue as numbers are few

  • leyburn19 Profile Picture
    2,157 on at

    That would work,  but you would still have issues with a dropdown to select as it will simply grow and depending on the ID position may sort based on that as text.  You names will also be all over the pace.  Combo might help with that. 

     

    My preference is to look at it completely differently.  I would have two galleries and form to do this.  Could be all on one view.

     

    Gallery one is list of students.  When a student is selected,  gallery 2 appears or you navigate to it.  In the onselect I would simply have a variable Set(varID,ThisitemID).  Now on gallery2 it is filetered based on second source and finds and data where the varID = Special ID column (not its ID) This ID column is populated with the varID when a new record is created.

     

    No in the second gallery.  If you want to edit an item,  It simply takes you to an adit form based on the same source items using Gallery?.Selected in its item property.  This form has the Special ID as a hidden Field that has a default of the VarID.  You can edit and save.  If you want to create a new record have an add button or a plus in the header to the second gallery.  This simply turns the edit form to a new form.  Fill in the form and submit.  As the hidden form has the VarID already,  this will now match it with the records in the second gallery and appear in your list

  • StuCundy Profile Picture
    377 on at

    Hi @leyburn19 

     

    1. My StudentListBrowseGallery is populated.  Onselect I have 

    Set(varID, ThisItem.ID);Navigate(StudentReportBrowseScreenIndividual);

    On select I get the BrowseGalleryStudentReport_1 which I need to filter by varID correct? Filter(StudentReport, "varID")

      Not sure how to do that. ..

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard