cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Gallery Transition

In a previous message by another user the Power Apps Hero stated that Power Apps does not support transition to a screen based on the contents of a field in the Gallery. However, one could transition to a Screen 1 if 'Screen 1' was in the Gallery. Where as if a specific title (i.e. Bus Driver), was in the Gallery a New Employee edit form screen would open. But, if different specific title (i.e. School Teacher) appeared the Transfer Employee edit form screen would open.

 

Can anyone provide clarification as to whether the above transition configuration is possible?

 

If(ThisItem.Value = "Screen1",Navigate(Screen1,ScreenTransition.Fade), ThisItem.Value = "Screen2",Navigate(Screen2,ScreenTransition.Fade),ThisItem.Value = "Screen3",Navigate(Screen3,Fade))

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I entered the following.

 

I get the following error message - "Name isn't valid. This identifier isn't recognized". 

 

Power Apps apparently doesn't like that I'm referencing the contents of and Html Text field in the Gallery.

 

BTW, I'm using Html text fields so that I can create a black label and blue content (i.e. - Cert Title: Professor)

 

Thoughts on how to correct the error?

 

 If(
    ThisItem.HtmlText1 in [
      "FitnessPEB",
      "Medical",
      "SCBA Fit Test",
      "Live Fire Refresher",
],
Navigate(CertQualDtlScrn),
Notify("No Update Allowed")
)

View solution in original post

7 REPLIES 7
Eelman
Super User
Super User

@Anonymous 

Yep, totally possible. You could even re-write that formula if you like, like this

 

Switch(ThisItem.Value,
    "Screen1",Navigate(Screen1,ScreenTransition.Fade),
    "Screen2",Navigate(Screen2,ScreenTransition.Fade),
    "Screen3",Navigate(Screen3,Fade)
)
Anonymous
Not applicable

So, how would I edit the below to transition to 'New Employee' form if 'Teacher, Doctor, Butcher or Athlete' appear in the title field of the Gallery. And, if 'Bartender, Astronaut, or Zookeeper nothing happens - if possible trigger an error or help message like 'No Update Allowed' form, 

 

Switch(ThisItem.Value,
    "Screen1",Navigate(Screen1,ScreenTransition.Fade),
    "Screen2",Navigate(Screen2,ScreenTransition.Fade),
    "Screen3",Navigate(Screen3,Fade)
)

 

@Anonymous 

Like this

Switch(ThisItem.Title,
    "Teacher",Navigate('New Employee',ScreenTransition.Fade),
    "Doctor",Navigate('New Employee',ScreenTransition.Fade),
    "Butcher",Navigate('New Employee',ScreenTransition.Fade),
    "Athlete",Navigate('New Employee',ScreenTransition.Fade),
    Notify("No Update Allowed", NotificationType.Error)
)

Notify can also be:

- Screen transition to an empty screen with a label that says "No Update Allowed", or

- A PopUp, but this is more work

 

Hi @Anonymous :

Do you want to add navigation buttons in the gallery

case1:ThisItem.Title in ["Teacher", "Doctor", "Butcher" ,"Athlete"]

Navigate to 'New Employee' screen

csse2:ThisItem.Title not in ["Teacher", "Doctor", "Butcher" ,"Athlete"]

Pop up error message

If so,I'v made a test for your reference:

1\My data source is a collection:

 

ClearCollect(GalleryTransition,{Title:"Teacher"},{Title:"Doctor"},{Title:"Butcher"},{Title:"Athlete"},{Title:"Bartender"},{Title:"Astronaut"},{Title:"Zookeeper"})

 

2\Add a gallery

3\Add an arrow into this gallery and set it's OnSelect proeprty to:

 

If(
    ThisItem.Title in [
        "Teacher",
        "Doctor",
        "Butcher",
        "Athlete"
    ],
    Navigate('New Employee'),
    Notify("No Update Allowed")
)

 

28.gif

Best Regards,

Bof

Anonymous
Not applicable

I entered the following.

 

I get the following error message - "Name isn't valid. This identifier isn't recognized". 

 

Power Apps apparently doesn't like that I'm referencing the contents of and Html Text field in the Gallery.

 

BTW, I'm using Html text fields so that I can create a black label and blue content (i.e. - Cert Title: Professor)

 

Thoughts on how to correct the error?

 

 If(
    ThisItem.HtmlText1 in [
      "FitnessPEB",
      "Medical",
      "SCBA Fit Test",
      "Live Fire Refresher",
],
Navigate(CertQualDtlScrn),
Notify("No Update Allowed")
)

View solution in original post

@Anonymous 

Use two standard labels instead of one HTML.text label in your gallery and colour them accordingly. Then reference the label that has "FitnessPEB", "Medical", etc in your formula

Anonymous
Not applicable

A small edited, see below, did the trick. Thank you!

 

If(
ThisItem.Title in [
"Title1",
"Title2",
"Title3",
"Title4",
],
Navigate(...Scrn),
Notify("No Update Allowed")
)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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