Happy Tuesday!
I'm currently using the Book A Room template on Power Apps and I was wondering if I could display different floor images on the same page. Or would I have to create a different screen for each floor level to display each floor plan image?
@hotdogman - I am not aware of the inner workings of that app but presumably it will record the selected room name (from a Dropdown or Gallery control or in a Variable for example).
You can use the Switch example to display a specific image based on the selected room name. Suppose for example the room name is associated to a Gallery selection, you would use:
Switch(
Gallery1.Selected.RoomNumebr,
"RS_KS11100",
'confirm-bg-copy-2@3x',
"RS_KSXXXXX",
'16_berylsea_light',
"RS_KSZZZZZ",
'157186112'
)
So let's say I booked a room on the first floor (RS_KS11100) how can I code the condition to show them the image of the first floor on the confirmation screen?
@hotdogman - you can dynamically display different images on the same image control based on the condition that you specify so long as the image exists in the media pane. As a basic example apply the below to the Image property of the Image:
If(
true,//your condition
'confirm-bg-copy-2@3x',
'another image'
)
Another version using Switch:
Switch(
YourSwitchValue,
"Result1",
'confirm-bg-copy-2@3x',
"Result2",
'16_berylsea_light',
"Result3",
'157186112'
)
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional