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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Navigate to Screen Dyn...
Power Apps
Unanswered

Navigate to Screen Dynamically using sharepoint list data - Left Nav Bar Menu Navigation

(0) ShareShare
ReportReport
Posted on by 249

I have a SharePoint list of records as shown below format

 

 

 

 

{
menu_name: "Home"
screen_name: "Home Screen"
},
{
menu_name : "Task"
screen_name : "Task Screen
}

 

 

 

 

I understand that `Navigate()` doesnt take string as input parameter. 

So as I work around,

 

I wanted to iterate over this table( menuTableList) and use if() to check if screen_name is "Home Screen" if yes I need to update the screen_name of this table collection with actual Home Screen control.

 

how to write the formula for this? I dont know how to loop over and do a conditional check and update the record.

 

NB: I have navigation componenet which accepts screen and navigate if the user clicks on some icons. 

 

-----

Detailed explanation

 

I understand that point, What I am trying to ask is that if I have a collection in the following format

 

 

 

{
menu_name: "Home"
screen_name: "Home Screen" // Screen Name String
},
{
menu_name : "Task"
screen_name : "Task Screen // Screen Name String
}

 

 

 

 

How can I modify this collection to replace screen name string with actual screen control? ( I understand that this can be done with a switch statement ie. A switch that accepts string name from the initial collection and modifies it with the actual screen control.)

 

 

 

 

{
menu_name: "Home"
screen_name: 'Home Screen' // Screen Control
},
{
menu_name : "Task"
screen_name : 'Task Screen' // Screen Control
}

 

 

 

Since  I am new to PowerApp Im not getting how to code this out.  My logic


  • Iterate over initial collection
  • for screen_name initiate switch case
  • replace string with actual screen control
  • return the collection

Could you please help me to code this?

 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @pcakhilnadh 

     

    Yes, you can achieve this by using the below expression:

     

    Navigate(LookUp(CollectionName, menu_name = "Value you want to check").screen_name)

     

    Here, you need to update the CollectionName to the name of your collection and Use the control/static reference for Value to check.

     

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • pcakhilnadh Profile Picture
    249 on at
    LookUp(CollectionName, menu_name = "Value you want to check").screen_name


    This is just lookup, right?

     

    In your answer

    • Navigate(LookUp(CollectionName, menu_name = "Value you want to check").screen_name) -> here Navigate() is getting a string and AFAIK  Navigate( Control ) requires control as parameter and string is not possible.

    Since `LookUp(CollectionName, menu_name = "Value you want to check").screen_name` is just look up What I wanted is to update screen_name with actual Screen Control. Since it is lookup it just looks up one value.

    What I wanted is iterate over that list, compare menu_name with a switch case and replace/add new column screen_name with actual screen control.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @pcakhilnadh 

     

    Yes, the lookup function will work in this case. I observed that while defining the collection, you added screen name in double quotes, which should not be the case. Can you keep the screen reference just like you keep control reference in the expression. If you pass screen name in single quotes (Same cases and spaces) then it will be recognized as a valid screen name.

     

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • pcakhilnadh Profile Picture
    249 on at

    Im storing the screen_name in sharepoint list. So when it retrieves it comes as string with double quotes. Is there any way to convert string to reference for the control?

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @pcakhilnadh 

     

    I am afraid there is no way to convert the text value to screen reference. You can use a collection as a workaround, like the one you are using earlier.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • pcakhilnadh Profile Picture
    249 on at

    I understand that point, What I am trying to ask is that if I have a collection in the following format

    {
    menu_name: "Home"
    screen_name: "Home Screen" // Screen Name String
    },
    {
    menu_name : "Task"
    screen_name : "Task Screen // Screen Name String
    }

     

    How can I modify this collection to replace screen name string with actual screen control? ( I understand that this can be done with a switch statement ie. A switch that accepts string name from the initial collection and modifies it with the actual screen control.)

     

    {
    menu_name: "Home"
    screen_name: 'Home Screen' // Screen Control
    },
    {
    menu_name : "Task"
    screen_name : 'Task Screen' // Screen Control
    }

    Since  I am new to PowerApp Im not getting how to code this out.  My logic


    • Iterate over initial collection
    • for screen_name initiate switch case
    • replace string with actual screen control
    • return the collection

    Could you please help me to code this?

     

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    Hi @pcakhilnadh ,

    If you had a Combo Box with the Collection as the Items, you could o this OnChange

    Switch(
     Self.Selected.screen_name,
     "Home",
     Navigate(HomeScreen),
     "Task",
     Navigate(TaskScreen),
     . the rest here . .
    )

     

    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.

     

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    Hi @pcakhilnadh ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

  • pcakhilnadh Profile Picture
    249 on at

    @WarrenBelz  Thanks for the heads up. I was not using any combo box as per your answer and as explained in the question I was already known about the use of a switch case. The challenge I had faced was "How can I modify this collection to replace screen name string with actual screen control?" ie the screen name was coming as string from sharepoint. so I wanted to modify the collection to replace a column value. Basically iterate over gallery and replace it.

    And yeah I solved it by adding a new columns to the existing list rather than replace using ShowColumn and AddColumns .

  • Verified answer
    pcakhilnadh Profile Picture
    249 on at

    Thanks you everyone who have helped me with this thread I found the solution by adding a new column to the existing collection rather than modifying an existing column using ShowColumn and AddColumns

     

     

    //navbarLeftMenuItemsDataList is sharepoint list which has menu items
    
    ClearCollect(navbarLeftMenuData,ShowColumns( AddColumns(navbarLeftMenuItemsDataList,"screenControl",
    Switch( screen_name_col.Value,
     "Home Screen String From List",'Home Screen',
     "Screen Two String From List", 'Screen 2',
     'Home Screen'
    )
    ),"column2","column3","column4","screenControl");

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard