cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Impactful Individual
Impactful Individual

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

Lefty
Impactful Individual
Impactful Individual

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?

Lefty
Impactful Individual
Impactful Individual

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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,034)