KEEP CALM and read the manual
Sometimes you just need to take time and read things, don’t you. Last Friday, I was looking for solutions with developing our Issues Tracking app at work that would allow me to support upload of attachments. The column existed, however I was struggling with sending my content from PowerApps > Forms then discovering what the created ID field was within the Tickets list. I’d been attempting to have Forms return the ID value to no avail.
Then, within the final minutes I noticed that Edit forms might be the way to go. I hadn’t actually used one, and I wasn’t about to invest the effort this late on a Friday afternoon; perhaps I should have, I barely slept the night as my mind was abuzz with what might be. This morning I arrived early to work and set to task, creating a new screen and adding an Edit Form.
What is interesting about the use of Forms is their auto layout; select the number of columns, the visual layout of elements and their labels (vertical or horizontal), and then select which fields you want. Interestingly, not all fields are added when you select your data source, I was forced to add additional fields each time. Another quirk associated with layout, fields are laid out on-screen in horizontal order depending upon the number of columns you selected, so if you had selected a two column layout these are ordered thusly:
|Field 1||Field 2|
|Field 3||Field 4|
Whilst basic field layouts are relatively easy, adding multi-line fields to the mix soon throws layouts askew and whitespace can appear everywhere. Indeed, today I needed to rethink the layout of my forms several times to maximise layout and minimise whitespace, in the end all working quite nicely.
I was surprised how easily the Edit Forms made creating content within SharePoint lists, most especially those attachments I had battled with throughout Friday, taking just 30 minutes. Once I had created the screen, added the Edit Form object and specified the associated table, selected the desired fields and connected to a button with NewForm(Form1).
Our app is ever closer to being finished now, I’m just constructing the comments functionality now, this needing some adjustments to the list to support working more easily with Forms. For me, another added bonus working with forms comes in the form of the OnSuccess and OnFailure events, these can be used to perform tasks based upon outcome of submissions, for example, where successful then subsequently reloading my collections and refreshing the galleries. Previously, I was relying upon a timer post-submit to add a delay after which I would do this, hence why it pays to read sometimes, you can save yourself a bit of time in the long run and clean-up down the track.