web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Path from clicks

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello. When I click on the recursive menu, I need to save the path and display it completely through slashes.

 

I have in Gallery1

 

Items:

Filter(Objects;CS_Parent=Text(tmp_loc.id) Or ID=Value(tmp_loc.id))

 

OnSelected:

UpdateContext({tmp_loc:{id:ThisItem.ID;title:ThisItem.Titel;parent:ThisItem.CS_Parent;container:ThisItem.CS_Container}});;Set(CS_Location;{id:ThisItem.ID;parent:ThisItem.CS_Parent;currentid:tmp_loc.id;title:ThisItem.Titel;path:Concatenate(CS_Location.title;" / ";tmp_loc.title)});;If(tmp_loc.container= false ;Navigate(FCamera;ScreenTransition.Cover))

 

In Label:

If(CS_Location.id > 0;CS_Location.path;"")

 

But Concatenate() does not work correctly. It builds a path only from 2 headings, inserts a slash on the first click and, when returning from another display, puts forward the final menu item. How to fix all this?

 

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your issue?

    Could you please share a screenshot about your app's configuration?

     

    Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try to modify your formula as below:

    Set the OnSelect property of the Gallery to following:

    UpdateContext({tmp_loc:{id:ThisItem.ID;title:ThisItem.Titel;parent:ThisItem.CS_Parent;container:ThisItem.CS_Container}});;
    UpdateContext( /* <-- Modify formula here. Use UpdateContext() function to store the CS_Location variable instead of Set() function */
    {
    CS_Location: {
    id: ThisItem.ID;
    parent: ThisItem.CS_Parent;
    currentid: tmp_loc.id;
    title: ThisItem.Title;
    path: Concatenate(path; " / "; tmp_loc.title) /* <-- Concatenate tmp_loc.title value with previous stored path value */
    }
    }
    );;
    If(tmp_loc.container= false; Navigate(FCamera;ScreenTransition.Cover))

    Please take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    Download (3).png
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Download (3).png

     

    Thanks for the decision, but it doesn't work for me. I have to transfer data to another display, so I can’t use the UpdateContext() function to display the path.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Download (4).png

     

     

    path:Concatenate(CS_Location.path;tmp_loc.title;" / ")

    This is how I started working, I just need to fix it somehow. How to remove the slash at the end of the path and how to clean up if I switched from another display?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    OnSelect in Gallery

    UpdateContext({tmp_loc:{id:ThisItem.ID;title:ThisItem.Titel;parent:ThisItem.CS_Parent;container:ThisItem.CS_Container;path:Concatenate(tmp_loc.path;tmp_loc.title;" / ")}});;Set(CS_Location;{id:ThisItem.ID;parent:ThisItem.CS_Parent;currentid:tmp_loc.id;title:ThisItem.Titel;path:tmp_loc.path});;If(tmp_loc.container=false;Navigate(FCamera;ScreenTransition.Cover))

    Text in Label

    If(CS_Location.id > 0;CS_Location.path;"")

    I managed to do it right. It remains to remove Undefined from the path. How can I do it?

     

     

    Download (6).png
    Download (5).png
    Download (6).png
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you want to remove the "Undefined" text from the path?

    If you want to remove the "Undefined" text from the path, I have made a test on my side, please take a try with the following workaround:1.JPG

     

    2.JPG

    Set the Text property of the Label to following:

    Concat(
     Filter(
     Split(Label1.Text, " / "), 
     Result <> "Undefined",
     Result <> ""
     ), 
     Result & " / "
    )

    On your side, you should type:

    If(
     CS_Location.id > 0;
     Concat(
     Filter(
     Split(CS_Location.path; " / ");
     Result <> "Undefined";
     Result <> ""
     );
     Result & " / "
     );
     ""
    )

     

    In addition, if you also want to remove the slash at the end of the path, please consider take a try to modify above formula as below:

    If(
     CS_Location.id > 0;
     Left(
     Concat(
     Filter(
     Split(CS_Location.path; " / "); 
     Result <> "Undefined";
     Result <> ""
     ); 
     Result & " / "
     );
     Len(Concat(Filter(Split(CS_Location.path; " / "); Result <> "Undefined"; Result <> ""); Result & " / "))-3
    );
     ""
    )

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you very match! All worked!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard