Hello,
I'm coming across a common (and complex) pattern within Forms and could use the community's help:
Pattern:
Example UI: Here is what I end up with, but again, a separate "input bar with "+" for each item" mixed with a Form, mixed with a Gallery (not shown below) makes for a complex UI:
I know this exercise starts with a logical table design (a good reference for this is the "Data Management Best Practices" forum post). Lets assume I we have that in place for this particular topic. I'm really interested in the UI and App elements here.
Please post your ideas, I'm certain we can all benefit from a standard approach.
Hi @ericonline,
Could you please share a bit more about your scenario?
Could you please share a bit more about the formula within the OnSelect property of the "+" button?
For your first question, do you want to type multiple and duplicate entries within the Edit form for different tasks?
If you want to type multiple and duplicate entries within the Edit form for different tasks, I think the Collection could achieve your needs. You could consider take a try to store the form data as a Collection (TempCollection) using ClearCollect function, then if you want to reference the same value within the form for Task2, you could pull data from the TempCollection.
I have made a test on my side, please take a try with the following workaround:
Set the OnSelect property of the "+" icon button to following formula:
ClearCollect(TempCollection,Form1.Updates);ResetForm(Form1)
Note: The Form1 represents the Edit form control within my screen.
Set the Default property of the Data card (which you want to remain same value as previous form) to following formula:
If(Form1.Mode=FormMode.New,First(TempCollection).Title,ThisItem.Title)
For your second question, if you want to display all task items within your app, I think the Gallery control could achieve your needs. You could consider take a try to create a sparated screen within your app, then within this screen, add a Gallery control to displays these task items.
For your third question, do you want to write these items back to one data source or each item to a separated data source?
If you want to write data back to your data source, please check if the Patch function and SubmitForm function could help in your scenario.
Patch function, SubmitForm function
Best regards,
Kris
Hi @v-xida-msft (Kris),
Thank you for putting some thought and energy into this. Its a tough problem to explain and I'm afraid I wasn't clear enough. Let me clarify a bit more:
RE: The "+" Button OnSelect property:
Here is what I'm going to try (no visuals at this time to share):
Will report back soon!
Thanks again.
This is what I have come up with some of my apps.
We have a lot of InfoPath documents we are migrating to PowerApps
One document, in particular, has about 150 Questions. So having multiple screens is really not an option. (Unless the user wants to click the next button all day).
I created a data form with dynamic positioning based on the previous control but we also had other tables with foreign keys in this document. So we had to add galleries into the PowerApp (Which is technically not a feature). The only problem is that when you get too far down the document with the galleries in the app and try and add an entry it causes the scrollbar position to go all the way to the middle of the DataCard.
This issue is described here but I found if you turn the "New Improved App Rendering" off then it works, but then you have other errors because you are using the old rendering engine.
If anyone has any other suggestions on how to make a scrollable screen with a one to many relationship I am all ears.
Great topic @ericonline! And I completely agree with your opening statement that this is a common issue.
I worked out a bit of a solution for a one-to-many problem (as @JonathanWest so eloquently described it) that I will try to describe in the hopes that it can add something to this discussion and we can all work out a good best practice. Wall of text inbound!
*edit* Out of respect for everyone and the massive scrolling they might endure, I put my wall of text in a spoiler tag.
We have a wire rope inspection section in our maintenance app in which our supervisors input the results of inspections of a number of wire ropes on a rig. There are about 13-18 individual wire ropes with between 1 and 5 user inputs for each one, the number varying by whether the rig has one or two winch lines and what guy-securement systems they use. Essentially, the wire ropes would parallel the tasks in your scenario. There are also related items in our inspection (drum inspections, notes, etc.) that parallel the non-task fields in your scenario. In total, there are three different data tables storing inspection data: one which has entries for all maintenance tasks, one for the wire rope inspections, and one for related aspects of the inspection as mention before. This is also a phone app, so much of the design is a result of that choice.
The way I sorted it out for us was to not use forms or galleries. Instead, I built a form-like structure that shows/hides and formats input areas based on a page-like navigation system. This also allowed the freedom to group input items that are related but not in the same data tables (i.e. no restrictions from galleries or forms). It was a bit of work but, in the end, I think it was worth it. Plus, I couldn't find another way to do it. In the case of having 150 different questions, this would be a tough build but depending on the questions, I would think there could be some way to do it where input areas could be reused and the layout was such that there could be a tenable pagination structure.
The navigation is controlled by a collection that acts like an index and is generated by the app for the specific inspection based on what rig is selected. Basically, there are buttons that change dynamically based on what the previous and next items in the index are, and these allow the user to go back and forth between items to enter data. I could see dynamically adding and removing items to this index, such as with your "+" button to add tasks. Also, the index has a key built in to tie it to the type of wire rope being inspected.
Inputs for the inspection are stored first in temporary tables, allowing the user to enter/edit inputs before submission. This actually came as a result of the app requiring offline functionality but it turned out to be a really great way to handle the one-to-many aspects. This makes it pretty easy to enter and check the data without constant writing to the source as well. When the user has completed putting in the required items, they can then submit the data. This is done through a Collect in our case as the data is a one-time submission (it wouldn't be prudent if they could edit inspections after the fact). In the case where users need to go back and edit data, it would be possible to pull data into the temporary tables and use Patch instead of Collect.
One note on this: the offline functionality/temporary table structure necessitated de-normalizing the data a bit so that there was some sort of key to tie the items together in lieu of a SQL generated ID. I ended up using a composite of the user ID, inspection date, and equipment ID in each table, which has worked well.
On the display/review side, this is where my approach differs quite a bit. Instead of a data review or anything like that, I created a graphic of a top-down view of a rig with the wire rope locations color-coded based on the completeness and quality assessment. I would assume having a summary shown from what is stored in the temporary tables would work, perhaps using a gallery based on the index and custom fields to display relevant information.
So, those are the high-level aspects of what I came up with. My solution is a bit complex but I didn't see any other way at the time given the needs associated with the scenario. Feel free to critique it or ask for more detail if you like. This was actually the first PowerApp I ever built, so I am sure there is plenty of room for improvement.
As stated before, this seems a common scenario and if we can work out some best practices I suspect it would be very helpful to a number of people.
Awesome write up @wyotim!
I have a couple questions for you:
Dude! Neat stuff. Are you ever in Seattle? We should hang out!
@ericonlineFor the first question, essentially yes, with some caveats.
The labels and inputs are dynamic in some cases so they change as the user selects different items.
In my case, all the items are required except for the notes area, so my primary validation method is making sure there are inputs for every item. Some of the items are radio controls but the majority of them are numerical, so the text boxes are set to numerical inputs which solve the majority of issues with the data entry. The user's inputs are assessed right away as the app compares the input to a specified boundary based on the wire rope type so they get instant feedback on what they entered, making it easy to see errors before submission. In that regard, the error handling is pretty light and handled in the input field before submission.
This does put a lot on the user but hopefully is enough to guide them and let them know if data was mis-entered. A complication with this is that an entry outside the normal bounds could be a legitimate entry, which is another reason for the light approach. Another aspect is that every completed inspection triggers an email with an out-of-bounds items noted so that our operations managers can review the data, so while not technically part of the error handling in-app, it is part of the process.
I am not sure if there are too many best practices to glean from my approach and I am definitely open to input as I want/need to grow in this area!
On the second question, the collection is initialized in the OnVisible section of the inspection screen, based on the selection from a gallery. There are two key items for our situation that decide which of the two versions to use, so a simple If statement is all that is needed.
As far as traversing the index, I use a UpdateContext on an arrow button to track a number. The number relates to the position in the index and is used for the text labels. I'll include my code so you can see it:
/* Button code for the next item */ If(
CurrentInspectionItem.Text = "Winch Line 1" ,
If(
LookUp(RigCollection, EquipmentID = EquipmentListBrowseGallery.Selected.ID).WinchLineCount = 1,
UpdateContext({LocationVariable: LocationVariable + 2}),
UpdateContext({LocationVariable: LocationVariable + 1})
),
If(LocationVariable < 19,
UpdateContext({LocationVariable: LocationVariable + 1}),
""
)
) /* Text code for the next item */ Substitute(
If(
CurrentInspectionItem.Text = "Winch Line 1",
If(
LookUp(RigCollection, EquipmentID = EquipmentListBrowseGallery.Selected.ID).WinchLineCount = 1,
LookUp(RigWireRopeLocationCollection,
ID = LocationVariable + 2,
RigLocationName
),
LookUp(RigWireRopeLocationCollection,
ID = LocationVariable + 1,
RigLocationName
)
),
If(
LocationVariable = 19,
"",
If(
LocationVariable = 18,
"Notes",
If(LocationVariable = 17,
"Clamps",
LookUp(RigWireRopeLocationCollection,
ID = LocationVariable + 1,
RigLocationName
)
)
)
)
),
If(
LookUp(
RigCollection,
EquipmentID = EquipmentListBrowseGallery_1.Selected.ID,
Sheaves
) = true,
"/Boomer",
"Sheave/"
),
""
)
For updating the number, the main complexity for my scenario is knowing if the rig has one or two winches and if the list is at the beginning or end of the list. The previous item button code is much the same just checking if the number is less than one to show that the selected item is the first one.
For the text, the complexity is a bit greater in that some items are altered (the Sheave/Boomer is truncated based on what the rig actually uses) and some items have to be made because they aren't wire rope items (Clamps and Notes). Obviously, this is before I learned to use the If statement in a non-nested way. I need to update the code a bit!
The number is the PK for the wire rope type, so I can reuse it to help in the quality assessment as well as setting up what should be shown/hidden and how it is formatted. That is essentially what everything is based on. The temp tables are also pre-made and ready for input. There is an Update function in the OnChange area of each input field so that it goes to the right place.
Unfortunately, I don't get to Seattle that often but maybe that needs to change. The last time I was in town was for the Microsoft Data Insights Summit last year, which was the old name for the Business Applications Summit. I didn't make it to the Summit this year sadly. If I head up to your area, I will shoot you a message for sure!
Let me know if I can clear anything else up. It's a bit difficult to describe but hopefully what I wrote is decently understandable. Again, feel free to offer any suggestions or critiques. There is plenty of room for improvement on my side and it would be great to get to a best practice of some kind for these scenarios.
*edit* Screenshot for reference. Again, this is the first app I ever made so any chuckling at the design is warranted. The color scheme is an attempt to use brand colors and results in a pretty bold scheme. I am in the process of revamping this app now, so it won't actually look like this by the end of the week.
So let me ask you this.
I may not be understanding your app very well but why didn't you just use different screens and navigate to them instead of hiding controls and what not. You still would have to build a Navigation Model for it depending on the entity and what questions needing to be asked.
That is a great question. I guess for two reasons: first, because the idea never occurred to me.
Second, because this app was already pretty screen heavy (it was at like 19 or so at that point), I was just trying to not have to build more onto it by that point. It was the first PowerApp I had made and I started on it basically when PowerApps went GA and released the first version in about 6 weeks. Truth be told, it was the first app I had ever made, not just my first PowerApp. My main experience is in Excel/VBA, which is a bit of a far cry from PowerApps, so I had/still have a lot to learn.
And really, once I got to the temporary table aspect along with the index, it was pretty easy to map the data to and from the input areas so it seemed a good approach at the time. And it has held up pretty well too. While I am currently redesigning the app, that approach is staying. (I am cleaning up the code a bit though. Those unnecessary nested Ifs...)
Mainly because the idea never occurred to me though. That does seem like it would be a cleaner approach (and the more obvious one in hindsight). Again, great question!
So in thinking a bit more about this, I realized there are some other areas that have a similar one-to-many structure which I approach in a much simpler manner. We have an area in an app to track and enter employee information such as training records. There are a number of these trainings that must be renewed, be it annually or some other multi-year scale. The way that I display these is in a nested gallery. I then have a pop-out form to add/edit/delete entries.
In keeping with the use of forms and the SubmitForm function, what about having a form for tasks and a form for the rest of the items? (Assuming this is a two-table design that is; you would need a form for each table basically.) On the tasks form, it could have a button to add another task (which would submit the current form and refresh it for another entry), and a button that went to the form to add the rest of the data (which would also submit the task form).
The information could then be shown in a nested gallery (a gallery of galleries?) next to the form area which would add the information as it is submitted, giving the user a view of their submissions. There could be buttons to allow the user to add/edit/delete from the gallery as well, which would bring up the applicable form.
This is certainly simpler in design than my previous offering. The main downside I see is how slow it would be to enter data. One monolithic form would be much faster for sure.
Episode Fourteen of Power Platform Connections sees David Warner and Hugo Bernier talk to Microsoft PM Jocelyn Panchal, alongside the latest news, videos, product reviews, and community blogs. Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show. Show schedule in this episode: 00:00 Cold Open 00:32 Show Intro 01:10 Jocelyn Panchal Interview 24:10 Blogs & Articles 29:50 Outro & Bloopers Check out the blogs and articles featured in this week’s episode: https://www.nathalieleenders.com/Blog/index.php/;focus=STRATP_com_cm4all_wdn_Flatpress_42136159&path=?x=entry:entry230511-101930#C_STRATP_com_cm4all_wdn_Flatpress_42136159__-anchor @NathLeenders https://www.keithatherton.com/posts/2023-05-12-msbuild2023-cloud-skills-challenge/ @MrKeithAtherton https://elliskarim.com/2023/05/13/how-to-find-files-in-onedrive-that-match-a-naming-pattern/ @MrCaptainKarim https://www.linkedin.com/pulse/my-fond-memories-scottish-summit-2022-pranav-khurana/ @pranavkhuranauk https://www.linkedin.com/feed/update/urn:li:activity:7061777660745560064/?updateEntityUrn=urn%3Ali%3Afs_feedUpdate%3A%28V2%2Curn%3Ali%3Aactivity%3A7061777660745560064%29 @thevictordantas Action requested: Feel free to provide feedback on how we can make our community more inclusive and diverse. This episode premiered live on our YouTube at 12pm PST on Thursday 18th May 2023. Video series available at Power Platform Community YouTube channel. Upcoming events: Power Apps Developers Summit – May 19-20th - London European Power Platform conference – Jun. 20-22nd - Dublin Microsoft Power Platform Conference – Oct. 3-5th - Las Vegas Join our Communities: Power Apps Community Power Automate Community Power Virtual Agents Community Power Pages Community If you’d like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions.
Welcome to our May 2023 Community Newsletter, where we'll be highlighting the latest news, releases, upcoming events, and the great work of our members inside the Biz Apps communities. If you're new to this LinkedIn group, be sure to subscribe here in the News & Announcements to stay up to date with the latest news from our ever-growing membership network who "changed the way they thought about code". LATEST NEWS "Mondays at Microsoft" LIVE on LinkedIn - 8am PST - Monday 15th May - Grab your Monday morning coffee and come join Principal Program Managers Heather Cook and Karuana Gatimu for the premiere episode of "Mondays at Microsoft"! This show will kick off the launch of the new Microsoft Community LinkedIn channel and cover a whole host of hot topics from across the #PowerPlatform, #ModernWork, #Dynamics365, #AI, and everything in-between. Just click the image below to register and come join the team LIVE on Monday 15th May 2023 at 8am PST. Hope to see you there! Executive Keynote | Microsoft Customer Success Day CVP for Business Applications & Platform, Charles Lamanna, shares the latest #BusinessApplications product enhancements and updates to help customers achieve their business outcomes. S01E13 Power Platform Connections - 12pm PST - Thursday 11th May Episode Thirteen of Power Platform Connections sees Hugo Bernier take a deep dive into the mind of co-host David Warner II, alongside the reviewing the great work of Dennis Goedegebuure, Keith Atherton, Michael Megel, Cat Schneider, and more. Click below to subscribe and get notified, with David and Hugo LIVE in the YouTube chat from 12pm PST. And use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show. UPCOMING EVENTS European Power Platform Conference - early bird ticket sale ends! The European Power Platform Conference early bird ticket sale ends on Friday 12th May 2023! #EPPC23 brings together the Microsoft Power Platform Communities for three days of unrivaled days in-person learning, connections and inspiration, featuring three inspirational keynotes, six expert full-day tutorials, and over eighty-five specialist sessions, with guest speakers including April Dunnam, Dona Sarkar, Ilya Fainberg, Janet Robb, Daniel Laskewitz, Rui Santos, Jens Christian Schrøder, Marco Rocca, and many more. Deep dive into the latest product advancements as you hear from some of the brightest minds in the #PowerApps space. Click here to book your ticket today and save! DynamicMinds Conference - Slovenia - 22-24th May 2023 It's not long now until the DynamicsMinds Conference, which takes place in Slovenia on 22nd - 24th May, 2023 - where brilliant minds meet, mingle & share! This great Power Platform and Dynamics 365 Conference features a whole host of amazing speakers, including the likes of Georg Glantschnig, Dona Sarkar, Tommy Skaue, Monique Hayward, Aleksandar Totovic, Rachel Profitt, Aurélien CLERE, Ana Inés Urrutia de Souza, Luca Pellegrini, Bostjan Golob, Shannon Mullins, Elena Baeva, Ivan Ficko, Guro Faller, Vivian Voss, Andrew Bibby, Tricia Sinclair, Roger Gilchrist, Sara Lagerquist, Steve Mordue, and many more. Click here: DynamicsMinds Conference for more info on what is sure an amazing community conference covering all aspects of Power Platform and beyond. Days of Knowledge Conference in Denmark - 1-2nd June 2023 Check out 'Days of Knowledge', a Directions 4 Partners conference on 1st-2nd June in Odense, Denmark, which focuses on educating employees, sharing knowledge and upgrading Business Central professionals. This fantastic two-day conference offers a combination of training sessions and workshops - all with Business Central and related products as the main topic. There's a great list of industry experts sharing their knowledge, including Iona V., Bert Verbeek, Liza Juhlin, Douglas Romão, Carolina Edvinsson, Kim Dalsgaard Christensen, Inga Sartauskaite, Peik Bech-Andersen, Shannon Mullins, James Crowter, Mona Borksted Nielsen, Renato Fajdiga, Vivian Voss, Sven Noomen, Paulien Buskens, Andri Már Helgason, Kayleen Hannigan, Freddy Kristiansen, Signe Agerbo, Luc van Vugt, and many more. If you want to meet industry experts, gain an advantage in the SMB-market, and acquire new knowledge about Microsoft Dynamics Business Central, click here Days of Knowledge Conference in Denmark to buy your ticket today! COMMUNITY HIGHLIGHTS Check out our top Super and Community Users reaching new levels! These hardworking members are posting, answering questions, kudos, and providing top solutions in their communities. Power Apps: Super Users: @WarrenBelz, @LaurensM @BCBuizer Community Users: @Amik@ @mmollet, @Cr1t Power Automate: Super Users: @Expiscornovus , @grantjenkins, @abm Community Users: @Nived_Nambiar, @ManishSolanki Power Virtual Agents: Super Users: @Pstork1, @Expiscornovus Community Users: @JoseA, @fernandosilva, @angerfire1213 Power Pages: Super Users: @ragavanrajan Community Users: @Fubar, @Madhankumar_L,@gospa LATEST COMMUNITY BLOG ARTICLES Power Apps Community Blog Power Automate Community Blog Power Virtual Agents Community Blog Power Pages Community Blog Check out 'Using the Community' for more helpful tips and information: Power Apps , Power Automate, Power Virtual Agents, Power Pages
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/
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! 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
User | Count |
---|---|
169 | |
73 | |
58 | |
49 | |
41 |
User | Count |
---|---|
243 | |
116 | |
105 | |
74 | |
73 |