cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Prodigy
Post Prodigy

Button in gallery to open new screen

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

10 REPLIES 10
Aapok
Resolver II
Resolver II

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
Post Prodigy
Post Prodigy

@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.

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
Post Prodigy
Post Prodigy

@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

 

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
Super User
Super User

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?

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

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
Post Prodigy
Post Prodigy

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

Helpful resources

Announcements

Power Platform Connections - Episode 7 | March 30, 2023

Episode Seven of Power Platform Connections sees David Warner and Hugo Bernier talk to Dian Taylor, alongside the latest news, product reviews, and community blogs.     Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.     

Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.    Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218  tom_riha      theapurva  takolota     Akash17  momlo     BCLS776  Shuvam-rpa     rampprakash  ScottShearer     Rusk  ChristianAbata     cchannon  Koen5     a33ik   Heartholme     AaronKnox        Matren        Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas      zuurg    rubin_boer   cwebb365   Dorrinda   G1124   Gabibalaban   Manan-Malhotra   jcfDaniel   WarrenBelz   Waegemma      If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated. 

Microsoft Power Platform Conference | Registration Open | Oct. 3-5 2023

We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida.   Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more.   Register today: https://www.powerplatformconf.com/   

Check out the new Power Platform Communities Front Door Experience!

We are excited to share the ‘Power Platform Communities Front Door’ experience with you!   Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well.       Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities.     Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.    Explore Power Platform Communities Front Door today. Visit Power Platform Community Front door to easily navigate to the different product communities, view a roll up of user groups, events and forums.

Welcome to the Power Apps Community

Welcome! Congratulations on joining the Microsoft Power Apps community! You are now a part of a vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun! Now that you are a member, you can enjoy the following resources:   The Microsoft Power Apps Community Forums If you are looking for support with any part of Microsoft Power Apps, our forums are the place to go. They are titled "Get Help with Microsoft Power Apps " and there you will find thousands of technical professionals with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Apps community forums! Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered!   Microsoft Power Apps IdeasDo you have an idea to improve the Microsoft Power Apps experience, or a feature request for future product updates? Then the "Power Apps Ideas" section is where you can contribute your suggestions and vote for ideas posted by other community members. We constantly look to the most voted Ideas when planning updates, so your suggestions and votes will always make a difference.   Community Blog & NewsOver the years, more than 600 Power Apps Community Blog Articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on building Power Apps. On the Power Apps Community Blog, read the latest Power Apps related posts from our community blog authors around the world. Let us know if you would like to become an author and contribute your own writing — everything Power Apps related is welcome!   Power Apps Samples, Learning and Videos GalleriesOur galleries have a little bit of everything to do with Power Apps. Our galleries are great for finding inspiration for your next app or component. You can view, comment and kudo the apps and component gallery to see what others have created! Or share Power Apps that you have created with other Power Apps enthusiasts. Along with all of that awesome content, there is the Power Apps Community Video & MBAS gallery where you can watch tutorials and demos by Microsoft staff, partners, and community gurus in our community video gallery.   Again, we are excited to welcome you to the Microsoft Power Apps community family! Whether you are brand new to the world of process automation or you are a seasoned Power Apps veteran. Our goal is to shape the community to be your ‘go to’ for support, networking, education, inspiration and encouragement as we enjoy this adventure together!   Let us know in the Community Feedback if you have any questions or comments about your community experience.To learn more about the community and your account be sure to visit our Community Support Area boards to learn more! We look forward to seeing you in the Power Apps Community!The Power Apps Team

Top Solution Authors
Top Kudoed Authors
Users online (4,499)