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

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
LRVinNC

------------------
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.

View solution in original post

1 REPLY 1
Super User
Super User

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
LRVinNC

------------------
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.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (2,953)