cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerSäm
Continued Contributor
Continued Contributor

Option to Close/Exit the entire App - Possible?

Hi All,

I have built the following hamburger menu. When I click on the respective option, the correct page opens, it should be like this. I have built it like this:

PowerSm_0-1652955664536.png

In the app it looks like this:

PowerSm_1-1652955942209.png


But now I want to say that when I click the last Option "Abmelden", the app should not redirect to a screen, but should close completely by itself.

How can I achieve that? Do you have any ideas?
Is there something like Exit App?

 

Thank you very much in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@PowerSäm 

I guess that the OnSelect formula of your gallery looks something like this:

Navigate(ThisItem.Screen)

You could maybe change that to the following:

If(ThisItem.Title = "Abmelden";
   Exit();
   Navigate(ThisItem.Screen)
)

Alternatively, you could navigate the user to an 'Exit Confirm' screen. That screen would contain a label 'Are you sure you want to exit?', and you could add an 'OK' button that calls Exit().

View solution in original post

9 REPLIES 9
WarrenBelz
Super User
Super User

Hi @PowerSäm ,

You need the Exit Function

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

PowerSäm
Continued Contributor
Continued Contributor

Hi @WarrenBelz and thank you for your quick reply.

 

But how can I do it in my specific case? Maby like this? (See pic below)

PowerSm_0-1652957048531.png

It seems that something is missing. 

 

I thank you in advance for your help.

@PowerSäm 

Actually looking at it again, you cannot in that structure - it is expecting a screen

timl
Super User
Super User

@PowerSäm 

I guess that the OnSelect formula of your gallery looks something like this:

Navigate(ThisItem.Screen)

You could maybe change that to the following:

If(ThisItem.Title = "Abmelden";
   Exit();
   Navigate(ThisItem.Screen)
)

Alternatively, you could navigate the user to an 'Exit Confirm' screen. That screen would contain a label 'Are you sure you want to exit?', and you could add an 'OK' button that calls Exit().

PowerSäm
Continued Contributor
Continued Contributor

Thank you, for your replies, @WarrenBelz & @timl.

 

@timl, I did not put these options behind a gallery, but behind the app itself, in the OnStart function (see pic below).

PowerSm_0-1653032868188.png

 

So is it possible to put your IF statement somewhere there too? Or is that not possible?

 

Otherwise I will work with the suggested workaround, the 'Exit Confirm' screen. 

 

Thank you in advance!

timl
Super User
Super User

Hi @PowerSäm 

I can't see any way of adding a call to Exit in your existing formula so if it's workable, I think the 'Exit Confirm' screen would be the easiest option here.

PowerSäm
Continued Contributor
Continued Contributor

Thanks for your quick reply, @timl .

 

Ok, then I will use the second way to work around this issue.

Thank you so much!

PowerSäm
Continued Contributor
Continued Contributor

Thanks for your quick reply, @timl .

 

Ok, then I will use the second way to work around this issue.

Thank you so much!

Chaitanya8
Frequent Visitor

I had a similar scenario when I wanted to close the entire tab on click of a button from powerapp. I tried using Exit() formula but it only redirects you to the other screen instead of closing it.

You can develop a PCF component to meet that requirement. 

Here's the link which can help you with the designing.

https://hameedhussaincom.wordpress.com/2021/02/25/create-a-new-pcf-button-control/ 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,730)