cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Post Prodigy
Post Prodigy

code help please

Hello all,

I have a canvas app, with SPO as its datasource.

I have a scenario where User1 has completed a section of the form.

User2 has now come to section2 to enter up to 7 reviewers (this is a case by case scenario, sometimes 2 reviewers sometimes 1, other times 5)

I have on that screens OnVisible created a variable Set(MyReviewer1,Lbl_Reviewer1.Text);// and so on for each reviewer (this is to cater for another scenario).

On my next button I want to it to be able to only navigate to a screen which has a reviewer entered by User2. So if User2 has entered Reviewer1 then the next button should navigate to Reviewer1Screen, but if User2 entered the names for Reviewer2 and 3 navigate to Reviewer2Screen then Reviewer3Screen.

I want to avoid the scenario where users need to click through 7 screens when there will be data on say 3 screens.

Is this possible?

I have a status column to cater for which reviewers complete there sections but not sure how I achieve this? 

Thank You 

5 REPLIES 5
Carsten_Growth
Power Apps
Power Apps

Switch(Scenario,

Reviewer1, Navigate(Screen1, Fade),

Reviewer2, Navigate(Screen2, Fade),

Reviewer3, Navigate(Screen3, Fade)

)

The code might look like to simple, but the logic inside a Switch() function should help you to select based on your scenario

Hi @Carsten_Growth 

Thanks

But I havent used the switch function before.

How will it know which screen to navigate to?

take a look here https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if for further documentation. OnSelect of one of your footer items, you would set a variable. Let´s say it becomes 1, 2 or 3. Then you can type something like Switch(variableName,

1, Navigate(Screen1, Fade), //do action when variableName = 1

2, Navigate(Screen2, Fade) //do action when variableName = 2

 

Got the idea?

HI @Carsten_Growth 

Afraid not, im not from a developer background.

Some help if you can, would be appreciated in terms of the code I would use on my button, or maybe if you have similar code, just so i can get the idea with how to use it 

You don´t need developer background. I already provided you a sample with

Switch(variableName,
1, Navigate(Screen1, Fade), //do action when variableName = 1
2, Navigate(Screen2, Fade) //do action when variableName = 2
)

All you need to do is use variableName and OnSelect of your buttons to show specific gallery set it to be 1, 2, ...
 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

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 (2,394)