cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Asy
Level: Powered On

When a button is pressed

Hello,

 

I have three same types of screens : screen 1, screen 2 and screen 3.

Screen 2 (shown below) interacts directly with screen 1 and screen 3.

 

Les suivis.jpg

I would like for the icon cross on the left corner a Navigate function to screen 1 when one button in screen 1 is pressed or Navigate to screen 3 when one button in screen 3 is pressed.

So I would like to find the right formula to do this can you please help me ?

 

I tried this formula :

If(Button2_8.Pressed=true;Navigate(Screen1;Fade)) Or if(button2_14.Pressed=true;Navigate(Screen3;Fade))

 

But it doesn't work..

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: When a button is pressed

Hi @Asy ,

Could you please share a bit more about your scenario?

Do you want the icon cross in left corner to navigate to screen1 when one button in screen 1 is pressed or Navigate to screen 3 when one button in screen 3 is pressed?

 

Based on the formula that you provided, I think there is something wrong with it. Currently, within PowerApps, the Pressed property of the Button control could not be used to detect if a button has been clicked.

 

As an alternative solution, I think the global variable could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Button2_8 button (which is a button in your Screen1) to following:

Set(TargetScreen; "Screen1")

Set the OnSelect property of the Button2_14 button (which is a button in your Screen3) to following:

Set(TargetScreen; "Screen3")

Then modify your formula as below (set the OnSelect property of the icon cross to following):

If(
TargetScreen = "Screen1";
Navigate(Screen1; ScreenTransition.Fade);
TargetScreen = "Screen3"
Navigate(Screen3; ScreenTransition.Fade)
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Super User
Super User

Re: When a button is pressed

In the On Select property of the icon you want to use to trigger the screen change, enter Navigate(Screen1,ScreenTransition.None). On Select represents the action to be taken when the object on the screen is selected/clicked.

In the example below, when the user clicks on the arrow head, the On Select executes 3 actions.  The first two are not important for your purposes.  The 3rd one is the one you need.  In my case, I move to the Summary screen.  There are 3 Screen Transition options - None, Cover, and Fade.  I use None most of the time.  The full syntax is as I showed you above ScreenTransition.None, but you can abbreviate in this command to just use the word None as I did in the example below.  So either Navigate(Screen1.ScreenTransition.None) or Navigate(Screen1, None) are equivalent.  

OnSelect.jpg

Community Support Team
Community Support Team

Re: When a button is pressed

Hi @Asy ,

Could you please share a bit more about your scenario?

Do you want the icon cross in left corner to navigate to screen1 when one button in screen 1 is pressed or Navigate to screen 3 when one button in screen 3 is pressed?

 

Based on the formula that you provided, I think there is something wrong with it. Currently, within PowerApps, the Pressed property of the Button control could not be used to detect if a button has been clicked.

 

As an alternative solution, I think the global variable could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Button2_8 button (which is a button in your Screen1) to following:

Set(TargetScreen; "Screen1")

Set the OnSelect property of the Button2_14 button (which is a button in your Screen3) to following:

Set(TargetScreen; "Screen3")

Then modify your formula as below (set the OnSelect property of the icon cross to following):

If(
TargetScreen = "Screen1";
Navigate(Screen1; ScreenTransition.Fade);
TargetScreen = "Screen3"
Navigate(Screen3; ScreenTransition.Fade)
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Asy
Level: Powered On

Re: When a button is pressed

@v-xida-msft 

 

Thank you very much for your help this is exactly what I'm tried to do !

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 204 members 4,478 guests
Recent signins:
Please welcome our newest community members: