cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Super User
Super User

Gallery button select location and have image display on another screen

I have a dashboard screen where people come in and select their current location from the list.  When they select that location it navigates them to another screen.  I need the matching image from the button they select to be the default image selected on the new screen

 

So if I select Basement 

Dorinda_0-1667236503004.png

 

The image that should show should be the map of the basement.  I need to know how to capture that information and on the navigation or the on visible have the image selected from the dashboard displayed.

 

I cannot figure out how to make this work.

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

@Dorinda ,

If you had all your images in a SharePoint Library with a field for the Location

, then you would set a Variable (example for Basement)

Set(gblLocation, "Basement");
Navigate(YourNewScreen)

Then the Image on the next screen would be

LookUp(
   YourLibrary,
   LocationField = gblLocation
).'{Thumbnail}'.Large

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

@Dorinda ,

You just need to change the Variable when you need to change the image - so you can also change it OnChange on your drop-down.

View solution in original post

16 REPLIES 16
WarrenBelz
Super User
Super User

@Dorinda ,

If you had all your images in a SharePoint Library with a field for the Location

, then you would set a Variable (example for Basement)

Set(gblLocation, "Basement");
Navigate(YourNewScreen)

Then the Image on the next screen would be

LookUp(
   YourLibrary,
   LocationField = gblLocation
).'{Thumbnail}'.Large

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

@WarrenBelz 

 

I understand what you are doing but I have a few images I need to switch between.

 

I tried this but it didnt work

LookUp('Map Images',Location=
Switch(glbLocation,
"BASEMENT",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_1.jpg?csf=1&web=1&e=Jx8FAb",
"FLOOR 1",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_2.jpg?csf=1&web=1&e=giwXRM",
"FLOOR 2",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_3.jpg?csf=1&web=1&e=txRrSB"
))

I have this on the button on the main landing page

Clear(GallerySelectedCubeFrom);
Set(glbLocation,Gallery1_1.Selected.sublocation);
Navigate(
   'Move Selection'
);

 

I am missing something here.

@WarrenBelz 

 

Also once I have the image selected from the main dashboard, I now need to be able to change it based on a dropdown

Dorinda_0-1667311160545.png

 

So the current image showing is basement but once I select the sublocation in the second dropdown it should change to Floor 1,

 

I have this on the dropdown but it is not changing because of the glbLocation we used before

Switch(glbLocation,
"BASEMENT",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_1.jpg?csf=1&web=1&e=Jx8FAb",
"FLOOR 1",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_2.jpg?csf=1&web=1&e=giwXRM",
"FLOOR 2",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_3.jpg?csf=1&web=1&e=txRrSB"
)

 

How can i do that?

@Dorinda ,

If you have the Location field in 'Map Images', you just need 

LookUp(
   'Map Images',
   Location = gblLocation
).'{Thumbnail}'.Large

You do not need to refer to SharePoint external URLs when you have the Library as a data source. You can also specify the name in a drop-down if you want.

 

@WarrenBelz 

 

But how does that work when I then have to make a change from the dropdowns?

 

I tried this

LookUp('Map Images','image sublocation'=Gallery1_1.Selected.sublocation,
Switch(Dropdown1_1.Selected.sublocation,
"BASEMENT",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_1.jpg?csf=1&web=1&e=Jx8FAb",
"FLOOR 1",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_2.jpg?csf=1&web=1&e=giwXRM",
"FLOOR 2",
"https://gcpud.sharepoint.com/:i:/r/sites/WorkspaceRelocationRequest/Map%20Images/EHQ_Page_3.jpg?csf=1&web=1&e=txRrSB"
))

 

Of course that didnt work because nothing is showing when I click the button on the dashboard that has this code:

Clear(GallerySelectedCubeFrom);
Set(glbLocation,Gallery1_1.Selected.sublocation);
Navigate(
   'Move Selection'
);

 

 

@WarrenBelz 

 

Basically what has to happen is on the landing screen they select thier current location and that loads into the next screen where they can choose where they want to move to either on the same location or change the building and floor completely that is what the dropdowns are for.

 

When they click on the Dropdown1_1 this will then change the image and the gallery overlay to that location so they can pick the new location they want to move to.

 

I have all of this working except the initial setting of the image from the dashboard.

@Dorinda ,

One simple question - do you have the Location field in 'Map Images' that matches the sub-gallery selection and/or the drop-down selection ? If so, simply set the Variable to this when relevant and use the code I provided. It is not much use looking up the Library when you are then going to hard-code the image address.

@WarrenBelz 

 

I get that and it works if that is the only time i need to set the image, however once that initial image is set, they will then validate where they are sitting and start the process of selecting where they want to move to.  

 

So if it is in the same floor that is easy but if it is another building they have to check a box which then shows two dropdowns one for the Building and one for the sub location.  (Yes I have these both in my Map Images library).

 

When they select the sublocation from dropdown1_1 that will then change the image displayed as well as the gallery that overlays it.

 

I need all of this on the image control

@Dorinda ,

You just need to change the Variable when you need to change the image - so you can also change it OnChange on your drop-down.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,671)