web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / View form to display i...
Power Apps
Unanswered

View form to display item based on 2 separate galleries

(1) ShareShare
ReportReport
Posted on by 13

Hello everyone. 

for simplicity, I have two galleries, Gallery 1 in screen 1 and Gallery 2 in screen 2, and I would like to display a form (in screen 3) based on gallery 1 selected item or gallery 2 selected item, whichever item selected by the user in the previous screen. What I have so far works for 1 gallery since the item property of my form is "gallery1.selected". What can I do to allow the user to view the form based on the selected item in gallery 1 or the selected item in gallery 2. 

 

I hope I was clear enough with my question. 

 

Thanks in advance.

Categories:
I have the same question (0)
  • One Profile Picture
    416 on at

    hi @Mehranmpr,

    the issue with this is that you are going to get problems if the galleries aren't using the same list because it won't be able to match up data cards properly. otherwise you are going to have to write an if statement to determine which form to use depending on which gallery was selected. I would also suggest disabling the other gallery until your data is submitted so you don't get any interference from the galleries. otherwise, you can use 2 forms and connect 1 to each gallery. then set the visible property dependent on which gallery gets selected.

     

    ------------------------------------------------------------------------------------------------------------------------------
    Please click "Accept as Solution" if this post answered your question so that it is helpful for people having similar questions. If you found this post helpful smack that Thumbs up button! Thanks!

  • Mehranmpr Profile Picture
    13 on at

    Thank you @One  for connecting,

    Luckily the two Galleries use the same SharePoint list and they are just filtered to display different information. having said that, how can I allow the form to display the selected item that is either selected in gallery 1 or gallery 2. Can this be done by modifying the Item property of my form with an "Or" operator or an if statement and if yes, how can this be done. 

    Thank you again.

  • One Profile Picture
    416 on at

    @Mehranmpr,

    exactly, you will just adjust the Item property of your form to:

    GalleryName.Selected || GalleryName2.Selected

    you are just going to want to make sure you have a way to deselect from the gallery or disable so the gallery's don't conflict with each other.

    ------------------------------------------------------------------------------------------------------------------------------
    Please click "Accept as Solution" if this post answered your question so that it is helpful for people having similar questions. If you found this post helpful smack that Thumbs up button! Thanks!

  • Mehranmpr Profile Picture
    13 on at

    @One,

    Unfortunately I get Invalid argument type error.

    As an Alternative method, can I use an if statement where if previous screen selected is screen 1, gallery 1.selected otherwise Gallery2.selected.

     

    @One , I appreciate your support

     

  • One Profile Picture
    416 on at

    @Mehranmpr,

    to use 1 form you will need to set the selected record id as a separate variable in the gallery OnSelect, then filter your list in the items property of your form to the ID variable. the items property of your form will use the following code after you adjust for your variables/list names:

    First(Filter('YourListName', ID = YourIDVariable))

     

  • jlucas Profile Picture
    24 on at

    Hi, I am trying to solve the same problem.

     

    Can you give a more detailed example of your above First(Filter(........ Solution, please?

  • shgall02 Profile Picture
    26 on at

    Yes, I will need more details on this, as well. I am having the same issue.

  • Suggested answer
    Fay AlQahtani Profile Picture
    2 on at
    I came to the same problem and tried several things, the only way that worked and is practical at the same time is the following:
    select gallery 1, go to OnSelect property and initialize a variable say  Set(RecordID, ThisItem.'ID') you can use other information from the record other than the ID but make sure its unique. 
    you want to also write : Navigate(screen3) 
    so the total value of the OnSelect property will be as followes:
    Set(RecordID, ThisItem.'ID');
    Navigate(screen3);
    repeat these steps for gallery 2 keeping the same variable name because you only want to change the value of the variable we initialized and you dont want to make a new variable (go to screen 2 select gallery 2 and choose the OnSelect property and assign the following to it) :
    Set(RecordID, ThisItem.'ID');
    Navigate(screen3);
    finally go to screen 3 and select the form and choose the Item property and assign it the following:
    LookUp('Table name', 'ID'=RecordID)
    hope it 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard