Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Possibility to retrace the previous screen

Posted on by 33

Hello folks!

 

In my application I would like to collect user feedback in which questions are asked. There is a central response screen, but two different ways to get there. I would like to record how the user got to the response screen. So, is there a way to trace back from which screen the user navigated to the response screen?

 

Thanks ahead!

  • Dr-Gazlamp Profile Picture
    Dr-Gazlamp 33 on at
    Re: Possibility to retrace the previous screen

    Awesome! This little work around works perfectly, thanks a lot!

  • zmorek Profile Picture
    zmorek 3,288 on at
    Re: Possibility to retrace the previous screen

    That's because when you use Parent.Name in a gallery, it's trying to get the name of the parent control (the gallery), which it can't do, rather than the name of the parent screen. 

     

    You can use the button in your gallery to select the button outside of the gallery, which will get you the name of the screen.

     

    Button in gallery OnSelect = Select(ButtonOutsideofGallery)

     

    Button out of gallery OnSelect = Set(myvar, Parent.Name)

  • Dr-Gazlamp Profile Picture
    Dr-Gazlamp 33 on at
    Re: Possibility to retrace the previous screen

    No, Im using it only once.

    But my navigate button is part of a gallery. I noticed when I set the variable outside of a gallery, then it works.

  • zmorek Profile Picture
    zmorek 3,288 on at
    Re: Possibility to retrace the previous screen

    Are you setting your variable "myvar" elsewhere in the app? That's telling you that it's getting set to different types in multiple places (e.g. text vs number)

  • Dr-Gazlamp Profile Picture
    Dr-Gazlamp 33 on at
    Re: Possibility to retrace the previous screen

    When setting the variable with Set(myvar, Parent.Name) I get the error message: "Incompatible type. Your formula can't be evaluated because the types of context variables aren't compatible with the types of values in other parts of your app." Why is that?

  • zmorek Profile Picture
    zmorek 3,288 on at
    Re: Possibility to retrace the previous screen

    Yes, you can set the Text() property of the label to myvar, which will display that information.

  • Dr-Gazlamp Profile Picture
    Dr-Gazlamp 33 on at
    Re: Possibility to retrace the previous screen

    @zmorek, Correct, I want to identify from which screen the user came from. The storage of the data at the end on a sharepoint list is not the problem at all, but rather how to get the information on which screen the user was before.

    When I navigate to the target screen (answer_screen) I set the variable "Parent.Name" in the OnSelect property of the navigate button: Set(myvar, Parent.Name)

     

    On the answer_screen I can now retrieve the value of the variable via a text label? How does this work?

  • zmorek Profile Picture
    zmorek 3,288 on at
    Re: Possibility to retrace the previous screen

    I can try! I'm not sure what you need though - you said you needed a way to identify what screen a user came from, which we've got so far. Where do you want to store this data, in a SharePoint list?

  • Dr-Gazlamp Profile Picture
    Dr-Gazlamp 33 on at
    Re: Possibility to retrace the previous screen

    Hi @zmorek, thanks for your reply and suggestion. Could you please describe in a little more detail how exactly to proceed? Unfortunately, I only have basic knowledge.

  • Verified answer
    zmorek Profile Picture
    zmorek 3,288 on at
    Re: Possibility to retrace the previous screen

    You can set a variable = Parent.Name. (SetvarWhatever,Parent.Name); Navigate(Screen). That will tell you the screen the user was on.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,733

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,750

Leaderboard