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 / Button in gallery to o...
Power Apps
Answered

Button in gallery to open new screen

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,


In my app I have this gallery on my home screen with the items value set to "colGalleryMenu".
sudosaurus_0-1657013347383.png
In the App/OnStart value I have this set to the below where the "view/eye" symbol takes the user to the applicable form. 

Set(
 clTheme,{
 clBlue: BlueSquare.Fill,
 clDarkBlue: DarkBlueSquare.Fill,
 clRed: RedSquare.Fill,
 clYellow: YellowSquare.Fill,
 clWhite: WhiteSquare.Fill,
 clGreen: GreenSquare.Fill
 }
);

Set(
 ftTheme,FontLabel.Font
);
ClearCollect(
colGalleryMenu,
{
MenuTitle: "Extra Care Application to keep a mobility scooter",
NavigateTo: ECAKMS_scrn
},
{
MenuTitle: "Extra Care Centra New Resident",
NavigateTo: ECCNR_scrn
},
{
MenuTitle: "Extra Care Person Centered Fire Risk Assessment",
NavigateTo: ECPCFRA_scrn
},
{
MenuTitle: "Extra Care Personal Emergency Evacuation Management Plan",
NavigateTo: ECOEEMP_scrn
},
{
MenuTitle: "Older Persons Support Agreement",
NavigateTo: OPSA_scrn
},
{
MenuTitle: "Supported Housing Move Out Checklist",
NavigateTo: SHMOC_scrn
},
{MenuTitle: "Support Plan Needs Assessment",
NavigateTo: SPNA_scrn
},
{MenuTitle: "Supported Housing Risk Assessment and Management Review",
NavigateTo: SHRAAMR_scrn
},
{MenuTitle: "Support Plan",
NavigateTo: SP_scrn
}
);


What I'd like to do is allow a user to navigate to a new SharePoint list item (screen) for each item by clicking on the "+" smybol - could I integrate this into the above code?

Categories:
I have the same question (0)
  • Aapok Profile Picture
    on at

    Assuming your NavigateTo: record is a reference to another screen in your app,

     

    On the OnSelect property of your + icon, you can try:

     

    Navigate(ThisItem.NavigateTo);

     

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @Aapok the Navigation takes the user to a list gallery of each form - there is then a + button on that screen which takes the user to another screen which contains the sharepoint list item where they can fill out a new form.

     

    So essentially from the chooser I wish for the user to be able to click the "+" button on the home screen list and take them to the required form screen to start filling out rather than going to the list view screen first.

  • Verified answer
    Aapok Profile Picture
    on at

    You can use the same logic as in my original reply: just add another item to the record, where the value is the screen you want the user to navigate to. 

    For example: 

    {
    MenuTitle: "Extra Care Application to keep a mobility scooter",
    NavigateTo: ECAKMS_scrn,
    NavigateToNew: some_scrn
    }

    then use ThisItem.some_scrn in your Icon's onSelect.

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @Aapok 

     

    The trouble with this is that I can only put one item into the onSelect property of my gallery

    So I wouldn't be able to apply onSelect properies for each row.

    sudosaurus_0-1657023731859.png

     

  • Aapok Profile Picture
    on at

    Instead of onSelect property of your gallery, I assumed you were using the onSelect property of your 'eye/view' icon for navigating to the applicable form, as your first post would imply. If you move the code from the onSelect of the gallery to the onSelect of the 'eye/view' icon, you can then add the code I suggested to the + icon's onSelect. This will stop redirecting the user when selecting the title though.

    I doubt it is possible to have the first navigation in the gallery.onSelect while having a different functionality in the + icon, but I'm not sure about that. I know the example I provided earlier works because I have used a similar functionality before.

     

    Edit: I just did a little testing and you can achieve the functionality with gallery.onSelect if you modify the tabIndex property of your gallery and + icon. For my testing I used tabIndex -1 for the gallery and 1 for the + icon.

  • WiZey Profile Picture
    3,023 Moderator on at

    The "OnSelect" property of a gallery is replicated on each of its row, there is no need to try and edit all the rows because the first one is already used as a model for the whole list.

     

    Also, the "OnSelect" of the gallery is called by its selected content if said content's property "OnSelect" use the function "Select(parent)" or another similar call. I don't think it's necessary to tinker with the control's "TabIndex" property.

     

    @sudosaurus Have you tried applying @Aapok idea of inserting "Navigate(ThisItem.NavigateTo)" inside one or another control's "OnSelect" property? If the result doesn't satisfy you, could you further elaborate on your aim?

  • RusselThomas Profile Picture
    4,014 on at

    Hi @sudosaurus,

    The Gallery OnSelect: property is just a convenient catchall that assumes all your gallery items will do something similar.  All the objects you add to your gallery have their OnSelect: property set to Select(Parent) by default, which means they all run the Gallery OnSelect: property when clicked.

    You can continue to use the Gallery OnSelect: property by building in logic that changes depending on the selected gallery item, but this still carries one action for any number of potential objects that could be clicked in a row.

    I haven't tried @Aapok's tabindex example (and I'd like to see it @Aapok - can you share more?) but a simpler method might be to just set the Gallery OnSelect: to false and setup OnSelect: behaviour for each of the icons in your gallery row by replacing Select(Parent) with your own instructions.

      

    For example, reiterating what @Aapok suggested, add another navigation field to each form entry  in colGalleryMenu, replace the Gallery OnSelect: property with false and then set the eye icon OnSelect: property to

    Navigate(ThisItem.NavigateTo)

     and set the + icon OnSelect: property to

    Navigate(ThisItem.NavigateToNew)

     Hope this makes sense,

    RT

  • Aapok Profile Picture
    on at

    Sure, the way I tested it:

    I created a collection with two different links like so:

     

    Set(a,Sequence(5, 1));
    ForAll(a, Collect(b, {title: "Screen2", link: Screen2, link2: Screen3}));
    Collect(b, {title: "diff", link: Screen3, link2: Screen2 });

    I didn't feel like typing out a larger list with different links, but still wanted to test with more than one gallery item. I also added an extra item after the ForAll just to make sure ThisItem works correctly in Gallery.OnSelect.

     

    I added a gallery a blank flexible height gallery, set the Items property to b.

    I added a Label to the gallery with ThisItem.Title as it's text property, and an Icon with Navigate(ThisItem.link) as the OnSelect of the Icon. 

    I edited the TabIndex of my Icon to 1 (from the default -1).

    I then added Navigate(ThisItem.link2) to Gallery.OnSelect.

     

    With this setup, if you click anywhere on the gallery item other than the Icon with TabIndex of 1, you will navigate to ThisItem.link2. 

    If you click on the Icon with TabIndex of 1, you will navigate to ThisItem.link

     

    Hopefully you could understand my solution despite bad naming policies, as it was a test I threw together very quickly just to test the idea I had.

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Thanks @Aapok - your solution is working as expected - it appeared I needed to take a lunch break to re-gather my thoughts - all makes sense now! 😉

    @RusselThomas thanks for the clarification - super helpful!!

     

    Thanks @WiZey for your contribution also! 👍

  • RusselThomas Profile Picture
    4,014 on at

    Thanks for sharing @Aapok - I guess I'm not really understanding where the tabindex comes into it. 

    I understood TabIndex to just be the order in which item focus is set when the user hits the tab button to jump from one input field to the next...

    Doesn't everything you explained work as you described without changing the tabindex?  

    Kind regards,

    RT 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard