Controls Optimization. Need help-over 400 on one screen
-
Controls Optimization. Need help-over 400 on one screen
Posted by DSC Communities on December 7, 2019 at 3:47 pm-
Amanda Oldham
MemberDecember 7, 2019 at 3:47 PM
-
I need help. I was lucky enough to go to a PowerPlatformWT event in Anaheim this week and it was the best experience EVER! I couldn’t figure out why my App was slow, and never realized the stethoscope on the screen had the clues I needed. I have a screen that the App checker says has over 400 controls! I need to optimize but don’t now know. I found in MS documentation that there is a 300 per screen “limit” and 500 app limit. At this rate, there would be over 800 per app so I know we will have to have duplicate apps.
Ā
Context: We have our audit system on SP2010 on prem. There are about 40 questions that are choice columns, as well as corresponding comment/multiline text fields. On top of this, in SP2010 we had a ton of calculated fields that would assign points per selection and then a final tally.
Ā
We want to make it better by SPO/PowerApps conversion. However, when this one form/gallery and lots of labels that do the calculationsā¦it is saying we have 400 controls. In what ways can we optimize?
*I tried to attach screenshots-and the wheel just spun forever*
——————————
Amanda Oldham
Claims QA
Orange
—————————— -
-
Warren Belz
MemberDecember 9, 2019 at 1:06 AM
Hi Amanda,I must admit I have learnt something new about the existence of these limits, however you mention “lots of labels that do the calculations”.
Have you thought of using Variables here? You could trigger them either as a bulk script from buttons and/or as OnChange events as the various components are populated, building the calculation as required. You could still see the end result/s in label/s displaying them, or even write to text inputs (having the Default as the relevant Variable and resetting them as required) to save if you are using the standard SubmitForm to save the data.
One last thing on the screen limits you mention – unless you need the user to see it, the item does not need to be on the relevant screen. I have an Admin screen on every app for this purpose and anything on it can be accessed through the app by simply referencing the control name.
I hope this is useful.
——————————
Warren Belz
Ventia Utility Services Pty Ltd
Rockhampton Qld Australia
+61 409 315 509
——————————
——————————————- -
Peter Heffner
MemberDecember 9, 2019 at 2:05 AM
Hi Amanda,
In addition to Warren’s comment, which was my first thought too š , I was wondering if 400 questions on one screen is still user-friendly.
Any chance to split it up by topics and patch/submit a smaller amount of fields as you move along?I also went away from Choice and Boolean fields and sometimes even from Person fields in Sharepoint and use text fields instead.
I had to migrate Sharepoint data with many lookups and other complex fields and Power Apps didn’t liked that at all.
Not sure but I think text/number fields are easier to handle than complex fields.
For Choices I use Collections to pick from (either Dropdown or Comboboxes) and store it in text plain fields.Can you give us some more details about your data? How many lists? How many columns by list?
——————————
Peter Heffner
Intranet Solution Specialist III
——————————
——————————————- -
Amanda Oldham
MemberDecember 9, 2019 at 3:00 PM
Thank you and ! This was my first time asking and I’m glad I did. It isn’t 400 questions…It is more like 35 choice field questions which…when the form is populated equal out to 5 controls per field (dropĀ and then there are corresponding comment boxes. One list w/ loads of columns, but we only load the ones assigned to the user (with a global variable) ??.One list so far-at least 150 columns. SharePoint Online is the data source.
Right now I was going to re-do everything by splitting up the massive form into 5 separate forms and putting them on different screens. I didn’t know we could have an “admin” type screen w/ calculations-that might be a huge saver! You’ve given me a lot to work through. I’m intrigued by the “collections” for choices…would it be a collection PER Choice field? or do you think there is a way to do a collection that has everything?
——————————
Amanda Oldham
Claims QA
Orange
——————————
——————————————- -
Warren Belz
MemberDecember 9, 2019 at 3:56 PM
Hi Amanda,I will start with a couple of things you may already know, but could be useful if not.
Firstly, you should be able to cut and paste all your calculation labels to the admin screen/s and they will continue to work as present.
Secondly, I am totally with Peter’s thoughts on avoiding SharePoint complex fields (Lookup especially and Choice). I made this mistake earlier and will not repeat it as now that PowerApps is not only my preferred interface for all things SharePoint, the Modern Experience allows the relevant app item display form to be copied directly to the PowerApps Integration edit/view function and with a small number of setting changes will function as if on a standalone app.
Now to collections. If you have not used them before, you should seriously consider an introduction. Put simply, they are data tables in the app’s memory which remain while the app is running. They are far quicker in responding than external tables, particularly on mobile devices and also support non-delegable queries.
I (like Peter) use them for almost all dropdown choices with the SharePoint field being plain text. I also have most galleries based on them. One limitation is the maximum number of items collected from SharePoint, which is standard 500 but can be increased to 2,000. They can be built bigger, but that is another subject.Your question on the number required would depend on the approach used. One method would be to set up a one or more “control” lists (which is what I do) and collect their contents. You could also create only one list using “distinct” on the relevant column in the dropdown choice field.
If your main SharePoint list is under 2,000 records or the first or last 2,000 records contain all the required fields somewhere, you could collect from there (again using “distinct” as above). The second one requires an ID descending sort on collection.I have probably given you too much info here, but good luck with your efforts.
——————————
Warren Belz
Ventia Utility Services Pty Ltd
Rockhampton Qld Australia
+61 409 315 509
——————————
——————————————- -
Peter Heffner
MemberDecember 10, 2019 at 1:25 AM
Amanda,Ā
regarding your question about collections, well, it depends… šMost the time I create my collections when the app isĀ started. Make sure you wrap the collections in the ‘Concurrent’ function like
Concurrent(
Ā Ā ClearCollect(collChoice1,….),
Ā Ā ClearCollect(collChoice2,….)
)This way multiple collections are started and processed in parallel vs. sequential which saves you time during the start of the app and you knwo where you find you Collections if you need to make changes.
On the other hand it can be a time saver if you create the Collections when a screen is displayed (screen – action – OnVisible). This makes sense if a collection is only used on that screen.
Sometimes, not often, I combine multiple values in a single collection. Typically if I have to deal with countries, country codes, currencies, regions, etc. You see this is all tight together and so I keep it in one collection. If I have to choose a country and need the currency for it, this comes in handy. But if I need to pick another currency, I use the same collection and choose from the (distinct) currency column. It wouldn’t be a benefit to have another collection with just the currencies if it is already there.
I guess there are as many ways to do that as there are folks out there who create apps. If I look at my apps from 3 years ago, I would do it different now.
Good luck!
//Peter——————————
Peter Heffner
Intranet Solution Specialist III
——————————
——————————————-
DSC Communities replied 5 years, 8 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘Controls Optimization. Need help-over 400 on one screen’ is closed to new replies.