cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mattthew
Advocate I
Advocate I

How To: Gallery Selected Sharepoint list 1 looks up sharepoint list 2 and displays form

Hello,

 

I have 2 sharepoint lists that are used as a relationship.  I would like to show an edit form if the gallery 1 (referencing sharepoint list 1)  is selected and shows a 1:1 match in sharepoint list #2  if not I have a bunch of input fields that patch over and in contrast would like those shown only if gallery 1 is selected and there is no 1:1 match in sharepoint list 2.

 

hopefully this makes sense and appreciate any help on how to solve this. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

HI @mattthew ,

Do you want to display the Edit form only when the Gallery1 item is selected, and only have single one record matches this selected item from your SP List2?

 

I assume that there is a common column between your SP List 1 and SP List2, please consider set the Visible property of the Edit form to following:

If(
   !IsBlank(Gallery1.Selected) && CountRows(Filter('SP List2', CommonID = Gallery1.Selected.CommonID)) = 1,
   true,
   false
)

Note: The CommonID represents the common column between the SP List 1 and SP List 2, on your side, please replace it with actual column name from your SP Lists. You use the Common Column to set up the relationship between the List 1 and List 2.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

HI @mattthew ,

Do you want to display the Edit form only when the Gallery1 item is selected, and only have single one record matches this selected item from your SP List2?

 

I assume that there is a common column between your SP List 1 and SP List2, please consider set the Visible property of the Edit form to following:

If(
   !IsBlank(Gallery1.Selected) && CountRows(Filter('SP List2', CommonID = Gallery1.Selected.CommonID)) = 1,
   true,
   false
)

Note: The CommonID represents the common column between the SP List 1 and SP List 2, on your side, please replace it with actual column name from your SP Lists. You use the Common Column to set up the relationship between the List 1 and List 2.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you @v-xida-msft  , quick question on this.  How would I adjust the edit form to be the filtered selection?

In item of the form it doesn't seem to allow me to do a filter.    Thanks again!

Actually I added a hidden gallery filtered based on your query above and adjusted the edit form item to that gallery.  That seems to have resolved the issue.  

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,760)