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 Platform Community / Forums / Power Apps / Need to create a compo...
Power Apps
Suggested Answer

Need to create a component which references sharepoint list

(3) ShareShare
ReportReport
Posted on by 126
I need to create a below component which should reference sharepoint list using the Gallery.
 
The image and the label like Home, Finance, Procurement and PO should be fetched dynamically from the SharePoint list. On clicking of the hamburger menu the component should expand and show the labels. The image and the labels should be clickable. It should also redirect to respective screens when clicked. The selected image/label should also be highlighted in proper color. May i know how to achieve this?
 
            
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    This is doable with a canvas component and a SharePoint list. Here's the approach.
     
    SharePoint list setup:
    Create a list with columns: Title (label text), Icon (text, store icon name or image URL), ScreenName (text, the screen to navigate to), SortOrder (number).
     
    Component setup:
    Create a canvas component. Add a custom property called IsExpanded (boolean, input) to control the hamburger toggle. Add another custom property SelectedItem (text, output) to track the active item.
     
    Gallery inside the component:
    Set Items to: SortByColumns(YourSharePointList, "SortOrder", SortOrder.Ascending)
     
    For each gallery item:
    - Add an Image control, set Image to ThisItem.Icon (or use a hardcoded icon set mapped by name)
    - Add a Label, set Text to ThisItem.Title, set Visible to the IsExpanded property
    - Set the gallery item's Fill to: If(ThisItem.Title = varSelectedNav, RGBA(0,120,212,1), RGBA(0,0,0,0)) for highlight
     
    Navigation on click:
    On the gallery item's OnSelect:
    Set(varSelectedNav, ThisItem.Title); Navigate(LookUp(colNavScreens, Title = ThisItem.Title).ScreenName)
    Since Navigate() doesn't accept a text string directly as a screen reference, the cleanest pattern is to use a Switch statement:
    Switch(ThisItem.ScreenName, "Home", Navigate(HomeScreen), "Finance", Navigate(FinanceScreen))
     
    Hamburger button:
    Add a button outside the gallery with OnSelect: Set(varExpanded, !varExpanded) and pass varExpanded into the IsExpanded component property.
    One thing to confirm: are your icons stored as image URLs in SharePoint, SVG strings, or are you using the built-in Power Apps icon set? That determines how to set the Image property in the gallery.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Poweruser32490 Profile Picture
    126 on at
     
    Image is an image column in SharePoint
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    Please follow @Valantis suggestion.
     
    For more clarity and some background follow below references:

    What YOU should follow

    For your exact requirement:

    1. Start with:
    2. Then:
    3. Then:

    One-line takeaway: Combine Gallery + Component + Navigate() + variable for toggle → you will get exactly the menu UI you showed.

    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

    Sunil Kumar Pashikanti, Moderator
    Blog:
     https://sunilpashikanti.com/posts/
  • Vish WR Profile Picture
    3,748 on at
     

    Besides this i recommend loading your SharePoint list into a Collection on the App.OnStart. This ensures your navigation loads instantly across all screens and minimizes the number of calls to your SharePoint site.

     
     
  • Poweruser32490 Profile Picture
    126 on at
    Hi @Valantis,
     
    I tried to set the Items property of the gallery to SharePoint list, but it doesnt allow me to set the list name inside component gallery. Below code fails. 
     
    Gallery inside the component:
    Set Items to: SortByColumns(YourSharePointList, "SortOrder", SortOrder.Ascending)
     
    For each gallery item:
    - Add an Image control, set Image to ThisItem.Icon (or use a hardcoded icon set mapped by name)
    - Add a Label, set Text to ThisItem.Title, set Visible to the IsExpanded property
    - Set the gallery item's Fill to: If(ThisItem.Title = varSelectedNav, RGBA(0,120,212,1), RGBA(0,0,0,0)) for highlight

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard