cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Identify previous screen for If(PreviousScreen=...)

Hi everyone,

 

I am trying to accomplish the same thing as this post, I need to fill a textbox with the field value from whatever screen they navigated from. How do I create a global or context variable that identifies the previous screen? 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Identify previous screen for If(PreviousScreen=...)

Just prior to executing your navigate to the new screen, do:

Set(LastScreen, <a unique value for that screen>)

Then you could use a Switch (or an If) to translate that value into the text to display, such as 

Switch(LastScreen, 1, "Screen A", 2, "Screen B", 3, "Screen C")

Alternatively, during your App - On Start, you could load a collection with the screen names associated with each value you are going to set in LastScreen.

ClearCollect(colScreens,
    {id:1,Name: "Screen A}, 
    {id:2,Name: "Screen B}, 
    {id:3,Name: "Screen C})

and then do a Lookup based on the collection using the LastScreen value you previously set in order to display the Screen Name.

Lookup(colScreens, id = LastScreen).Name

View solution in original post

1 REPLY 1
Super User
Super User

Re: Identify previous screen for If(PreviousScreen=...)

Just prior to executing your navigate to the new screen, do:

Set(LastScreen, <a unique value for that screen>)

Then you could use a Switch (or an If) to translate that value into the text to display, such as 

Switch(LastScreen, 1, "Screen A", 2, "Screen B", 3, "Screen C")

Alternatively, during your App - On Start, you could load a collection with the screen names associated with each value you are going to set in LastScreen.

ClearCollect(colScreens,
    {id:1,Name: "Screen A}, 
    {id:2,Name: "Screen B}, 
    {id:3,Name: "Screen C})

and then do a Lookup based on the collection using the LastScreen value you previously set in order to display the Screen Name.

Lookup(colScreens, id = LastScreen).Name

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (4,969)