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 / How to navigate from a...
Power Apps
Answered

How to navigate from a gallery that is in a Library Component?

(1) ShareShare
ReportReport
Posted on by 299 Moderator
I am building 2 Library Components:
 
Dynamic Action (new and existing actions)
 
Actions Gallery (list of actions)
 
I managed to pass the data all right for all fields, but I can't figure out how to get the 'edit' button inside my gallery to Navigate to the other screen.
 
Copilot insists in adding Custom output properties, but those are never shown in the parent app component, not even in the formula section, so I can't assign it a value to something I can't 'call'
 
It also suggested a custom input property, but still not clear how I'd get it to navigate
 
In the past it suggested to add a button in the parent app, which sounds like a duplication
 
Also I originally built the gallery without any component, the idea was that 'on select' it would 'rebuild' the flattened record from app 1 in app 2 as they are always complex columns such as lookup columns or choice columns
 
Unsure if I will be able to rebuild the record, or I guess it might have to be done by the parent app too
 
 
Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,664 on at
    refer this articles:
     
    you will be able to understand about the enhanced properties and leverage them
     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn || 📘 Explore more on my articles

  • inanoffice23 Profile Picture
    299 Moderator on at
    Thank you for your response AJ, 
     
    Although I read the article, I'm still not able to make it work
     
    Copilot keeps asking me to do an 'Event' of type 'Action' which is impossible
     
    It then mentions to set a parameter of parameter, and no need to return a record
     
    Do you have a sample of what I need to add for this? 
     
    At the moment I have
     
    Library Component

    DisplayName: OnButtonClicked
    Property type: Event
    Return data type: should this be Record?
    Parameter: do we add any? 
     
    Edit button inside gallery: 
    ActionsGalleryComponent.OnButtonClicked()
     
    Do I need any other custom properties? 
     
    Parent app:
     
    I can see OnButtonClicked now in the formula bar in my parent app, how do I ensure user can navigate to the next screen?
     
    This is the record I'm trying to pass when user selects edit button in gallery it has look up columns and choice columns
     
     
    
       {
            'Action Identifier': "AI-1025",
            'Lookup To Parent Table Record Reference': {
                Id: 1,
                Value: "CA-1320"
            },
            'Lookup To Parent Table Claim Number': {
                Id: 1,
                Value: "P-123789"
            },
            'Dynamic To Be Completed By Person': {
                'Full Name': "Joe Bloggs",
                'Primary Email': "joe@example.com"
            },
            'To Be Actioned By Date': Today(),
            Action: "Follow up with person",
            'Action Details': "Detailed steps to follow...",
            'Action Status': {Value: "Pending"},               
            'Comments from Person to Action': "Initial review done"
        }
     
  • Suggested answer
    developerAJ Profile Picture
    4,664 on at
    attached sample component
     
    - cmp_GalDemo_1:
        Control: CanvasComponent
        ComponentName: cmp_GalDemo
        Properties:
          X: =196
          Y: =78
          onButtonClick: =Navigate(Screen2,ScreenTransition.None,SelectedRecord)
     
    this is how you use in the main app. all you need to do is set what happen on button click

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn || 📘 Explore more on my articles

  • inanoffice23 Profile Picture
    299 Moderator on at
    Thank you AJ,
     
    Quite helpful, just missing a trick somewhere. I can never do anything like 'ThisItem' as it always says it expects a record, but of a different schema
     
    I have a custom property for my GalleryItems, then inside my gallery I have as Items this generic filter
     
     
    Filter(
        ActionsGalleryComponent.GalleryItems,//Record filter
        IsBlank(ActionsGalleryComponent.RecordReference) || 'Lookup To Parent Table Record Reference'.Value = ActionsGalleryComponent.RecordReference.Value,
       
        //Status filter: handles default,"All Statuses",and multi-select
        If(
            IsBlank(agc_ActionStatus_cmb.SelectedItems) || CountIf(
                agc_ActionStatus_cmb.SelectedItems,
                true
            ) = 0,
            'Action Status'.Value in ActionsGalleryComponent.ActionDefaultStatus,
            "All Statuses" in agc_ActionStatus_cmb.SelectedItems.Value,
            true,
            'Action Status'.Value in agc_ActionStatus_cmb.SelectedItems.Value
        ),
       
        //Search filter
        IsBlank(agc_ActionSearch_txb.Text) || StartsWith(
            Text('Action Identifier'),
            agc_ActionSearch_txb.Text
        )
    )

     
  • inanoffice23 Profile Picture
    299 Moderator on at
    I made a little progress
     
    Good: I can navigate to another screen
    Bad: User has to select gallery record, and then click a second button to do that
     
    Question: how can I ensure user clicks inside the gallery and gets taken to the right screen?
     
    Below is inside the library component gallery, the 'edit' button
     
    Select(Parent);
    ActionsGalleryComponent.OnButtonClicked()
    
     
    I found a 'Screen' mention here, but it only works if the button is outside the component OnSelect action on components to navigate to screen
     
     
  • developerAJ Profile Picture
    4,664 on at
    Please add the component here i will fix it and send you
  • inanoffice23 Profile Picture
    299 Moderator on at
    Thank you for the offer AJ, 
     
    I would love to but the security controls won't allow me to send the file
     
    I am getting a bit closer
     
    The error checker has flagged this:

    'OnButtonclicked' is an unknown or unsupported function in namespace 'ActionsGalleryComponent'. 
     
    My library component is called ActionsGalleryComponent, 
     
    My component in the parent app was called ActionsGallery_1, and I renamed it to match it, still flags as an error
     
    It's strange because I see the 'OnButtonClicked' in my parent app
  • Verified answer
    inanoffice23 Profile Picture
    299 Moderator on at
    I have fixed it at last :)
     
    I had some sample data OnButtonClicked in my Event in the library component, I deleted it and it now works
     
    Inside the gallery 
     
    Select(Parent);
    ActionsGalleryComponent.OnButtonClicked()
     
    2 more custom properties
     
    TargetScreen of type Screen
    SelectedActionFromGallery, data, output, record
     
    In the parent app
     
    On visible screen, set the variable Set(GotoAction, 'Name of your screen')
    TargetScreen add GoToAction (it cannot accept screen name directly as it wants a Control)
    OnButtonClicked has not only the navigation, but also I specify how the record is meant to look like, otherwise it won't work
     
    Thank you so much for all your help :) 
     
    // Create a local variable to hold the selected action
    Set(selectedAction, ActionsGalleryComponent.SelectedActionFromGallery);
    
    // Clear the previous record
    Set(SelectedActionRecord, Blank());
    
    // Build the new record using the local variable
    Set(SelectedActionRecord,
        {
            'Action Identifier': selectedAction.'Action Identifier',
            'Lookup To Parent Table Record Reference': {
                Id: selectedAction.'Lookup To Parent Table Record Reference',
                Value: selectedAction.'Lookup To Parent Table Record Reference'.Value
            },
            'Lookup To Parent Table Claim Number': {
                Id: selectedAction.'Lookup To Parent Table Member Number',
                Value: selectedAction.'Lookup To Parent Table Member Number'.Value
            },
            'Dynamic To Be Completed By Person': {
                'Full Name': selectedAction.'Dynamic To Be Completed By Person'.'Full Name',
                'Primary Email': selectedAction.'Dynamic To Be Completed By Person'.'Primary Email'
            },
            'To Be Actioned By Date': selectedAction.'To Be Actioned By Date',
            Action: selectedAction.Action,
            'Action Details': selectedAction.'Action Details',
            'Action Status': selectedAction.'Action Status',
            'Comments from Person to Action': selectedAction.'Comments from Person to Action'
        }
    );
    
    // Navigate to the next screen with the record
    Navigate('Dynamic Action Screen', ScreenTransition.None,
        {
            Record: SelectedActionRecord
        }
    );
    Navigate(ActionsGalleryComponent.TargetScreen)
     
  • developerAJ Profile Picture
    4,664 on at
    Thats great to hear
     
    please close the thread by marking solution as verified

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard