cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mcgej001
Frequent Visitor

Working with two or more gallerys

I'm working with multiple galleries.  1st screen is  gallery for the user to select a region (East, West, Central).  Based on what  is selected, the screen will navigate to Job Titles for that given region.  (Tech Suppot, Manager, Sales Asc, sales director). The user will select a job title and then naviate to a 3rd screen I have set up a edit from.  I can display infomation from my Region gallery in from1 but can only have one data source display in from2 where I want to display what job title was selcted based on the region that was selected in my fist gallery.   On that same screeen I'll have a text  input where the user can add text and then hav that submitted to a SP list to hold all the information.

 

I'm having trouble getting what job tilte was selected becusae I can only have one data source and each region has it's only SP list wiht different job titles. 

 

can you help me?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Working with two or more gallerys

Hi @mcgej001 ,

Could you please share a bit more the data source you used within your app?

Could you please more details about the Form1 and Form2 that you mentioned?

Further, do you mean that each region has a related SP list with different Job Titles?

 

I suppose that each region you selected within your Gallery1 has its own related SP list with different Job Titles, is it true?

If each region you selected within your Gallery1 has its own related SP list with different Job Titles, you need to add all related Region SP lists into your app firstly, then within the Gallery2 in your 2nd screen, you should choose what SP list data records should be displayed based on the selected region within your 1st Gallery.

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of 2nd Gallery  (Gallery2) within your second screen to following:

If(
   Gallery1.Selected.Region = "East",
   "East SP list",
   Gallery1.Selected.Region = "West",
   "West SP List",
   Gallery1.Selected.Region = "Central",
   "Central SP List"
)

Note: The "East SP List", "West SP List" and "Central SP list" represent the corresponding SP list related to your different region. And I assume that all these "Region" SP lists have same data structure.

 

After that, within your 3rd screen, you could reference the selected Job Title using the following formula:

Gallery2.Selected.JobTitle

Please take a try with above solution, check if the issue is solved.

 

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
Super User
Super User

Re: Working with two or more gallerys

I do this in nearly every application I develop, for example, departments on the first screen, projects on the second, and select a project to edit on a third, although I do use separate lists for this.

What you need to do is filter on your selected region so you can display only the job titles associated with that region. For clarity, I save the selected item, in your case region, in global variable that I can refer to later.  I do this just before navigating to form2, something like Set(MyRegion, <FieldwithRegion>).  Here is an example from one of my apps.  Title contains my Department and is what is displayed in my gallery on screen1.

R1.jpg

Then I filter the items on the second screen to include only those for my selected department, or in your case, region.  You didn't provide specific list and column names, but it would be something like:
Filter(MyList, <FieldwithRegion> = MyRegion).  Here's an example from the same app as the prior screen capture which filters for only projects in the selected department.  My filter is a little more complicated because I also filter for a specific project year.  Then I have wrapped the filter in a sort so that the projects appear in alpha order.

 R2.jpg

 

Hope this helps point you in the right direction.

Community Support
Community Support

Re: Working with two or more gallerys

Hi @mcgej001 ,

Could you please share a bit more the data source you used within your app?

Could you please more details about the Form1 and Form2 that you mentioned?

Further, do you mean that each region has a related SP list with different Job Titles?

 

I suppose that each region you selected within your Gallery1 has its own related SP list with different Job Titles, is it true?

If each region you selected within your Gallery1 has its own related SP list with different Job Titles, you need to add all related Region SP lists into your app firstly, then within the Gallery2 in your 2nd screen, you should choose what SP list data records should be displayed based on the selected region within your 1st Gallery.

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of 2nd Gallery  (Gallery2) within your second screen to following:

If(
   Gallery1.Selected.Region = "East",
   "East SP list",
   Gallery1.Selected.Region = "West",
   "West SP List",
   Gallery1.Selected.Region = "Central",
   "Central SP List"
)

Note: The "East SP List", "West SP List" and "Central SP list" represent the corresponding SP list related to your different region. And I assume that all these "Region" SP lists have same data structure.

 

After that, within your 3rd screen, you could reference the selected Job Title using the following formula:

Gallery2.Selected.JobTitle

Please take a try with above solution, check if the issue is solved.

 

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

mcgej001
Frequent Visitor

Re: Working with two or more gallerys

 

Thank you for the quick response. I do have separate SP lists for each of my Gallery’s. The first SP list is the Neighborhood Gallery with “DCA Central”, “DCA East”, “DCA West”, and “Downtown Disney” as options. (Picture 1) I changed the OnSelect property to this formula

 

If(ThisItem.Title="DCA East",Navigate(East_Key,ScreenTransition.None);Error);If(ThisItem.Title="DCA West",Navigate(West_Key,ScreenTransition.Fade);Error);If(ThisItem.Title="DCA Central",Navigate(Central_Key,ScreenTransition.Fade);Error);If(ThisItem.Title="Downtown Disney",Navigate(DTD_Key,ScreenTransition.Fade);Error);SubmitForm(Form1)

 

This formula will navigate to the desired gallery based on what I select and displays the LOB’s for that region.

I have four additional gallery’s all from different SP List’s displaying LOB’s for each of the potential regions selected.  The “IF” formula above navigates to the correct Gallery.

 

I set the OnSelect property’s for each of the LOB items to navigate to a form. On that form I have displayed the correct Neighborhood selected. The data source is coming from the Neighborhood SP list and I changed the Item to “Neighborhood.Selected” to display what Neighborhood was chosen.

 

Where I need help is: I have a second form that I want to display what LOB was choses but because these are coming from four different SP lists, I don’t know how to have it chose the one that was selected.

 

Ultimately I would like the user to select a Neighborhood, Select an LOB from that Neighborhood, and have that displayed on a 3rd screen along with a status field I’ll create later and a text input for the user to type in a request. When everything is finished, I would like that to be saved to an additional SP list that will store all the selections and Text Inputs. How to I send this to a completely separate SP list?

 

Thank you for your help, I'm still learning a lot but enjoying this.

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,770)