cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Re: Referring to a Control via a formula?

Sure, I've created a Contact template app and added a Waffle button on the main screen that goes to the last screen of the Screens collection. The collection gets created in the OnVisible property of the main screen so you might want to test this on a published version because the designer doesn't always trigger the OnVisible correctly.

Highlighted
Community Support
Community Support

Re: Referring to a Control via a formula?

Hi @Yahya,

 

Could you please share a bit more about your scenario?

Do you want to navigate to different screens using one Button control with same formula?

 

When you use the Navigate function within your app, you must specify which screen you want to display or navigate to firstly.

 

If you want to use a variable to store the Screen you want to display or navigate to when one screen is loading, I afraid that there is no way to achieve your needs in PowerApps currently.

 

I agree with @Eickhel's thought almost, you could consider take a try to store all screens within your app. Please set the OnVisible property of your Menu Gallery screen to following formula:

ClearCollect(ScreenCollection,[[@ScreenA],[@ScreenB],[@ScreenC],...[@ScreenN]])

Note: ScreenA, ScreenB,...ScreenN represents the screen name within your app.

 

The OnSelect property of the Navigate button set to following formula (Naviagte to ScreenA):

Navigate(First(ScreenCollection).Value,ScreenTransition.Fade)

If you want to navigate to ScreenB, please take a try with the following formula:

Navigate(First(Remove(FirstN(ScreenCollection,2),FirstN(ScreenCollection,1))).Value,ScreenTransition.Fade)

If you want to naviagate to ScreenC, please take a try with the following formula:

Navigate(First(Remove(FirstN(ScreenCollection,3),FirstN(ScreenCollection,2))).Value,ScreenTransition.Fade)

If you want to naviagate to ScreenN, please take a try with the following formula:

Navigate(First(Remove(FirstN(ScreenCollection,N),FirstN(ScreenCollection,N-1))).Value,ScreenTransition.Fade)

 

More details about the FirstN function and Remove function in PowerApps, please check the following formula:

FirstN function, Remove function

 

More details about the Disambiguation operator (@) in PowerApps, please check the following article:

Disambiguation operator

 

Best regards,

Kris

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.
Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Referring to a Control via a formula?

Hi @v-xida-msft and @Eickhel,

 

Thanks. still not working for a reason or another. The thing I wish to achieve is to automate navigation of my PowerApp which I have designed to look like SharePoint online. see attached. 

 

 

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Referring to a Control via a formula?

I have shared 2 screens of my PowerApp. Home and Project. 

 

in both, please forget about the gallery showing country it is for testing only.

 

The Gallery at the left is MenuGallery and it reads from CDS entity JuliApp Menu. It can be a collection.

 

The point of using a gallery to navigate has many useful reasons such as it can extend to much more App/device Screen height, also that Red highlight of the current screen is needless to say nice/useful, which I achieve easily, also location is fixed. If Buttons are used then, you know..

 

In attachments 4 and 5, I show the formula I use in OnSelect of that Gallery that exists in both Screen000_Home and Screen050_Project, and navigation works perfectly.

 

My point is that, for +60 screens, that formula really will be long, and I am afraid will have negative effect of App performance. So, I wish use a formula like this as simple as this for OnSelect the Menu Gallery in all screens: -

 

Navigate(ThisItem.abcd_screenname,ScreenTransition.Cover)

 

It is needless to say that the above does not work.

 

Do you think there is a way?

 

 

Highlighted

Re: Referring to a Control via a formula?

Hey,

 

I think the methods provided by both @v-xida-msft and me could help you build this type of interface but I'm not really sure about the issues you're facing with this.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,775)