Power Apps Gallery Edit Form Tutorial for Beginners

Power Apps Gallery Edit Form Tutorial for Beginners Hello everyone reza here in this video i will show you how to connect a gallery control to an edit form control we will reuse the form control so users can create edit and view.

Power Apps Gallery Edit Form Tutorial for Beginners

Data and i will also show you how we can leverage the same technique to create an editable grid experience wherein the user can also add.

Attachments related to the item so let's check out this video in action [Music] the two most widely used controls in power apps are the gallery control which.

Allows us to list our data and a form control which allows us to interact with our data create items edit items of view items the gallery and the form control are.

Connected to the same data source my data source here is a sharepoint list called inspection the same concept will work for any other data source of your choice.

When the user lands on the home screen of this app the form control by default is set to new mode so the user can create a new item in my.

Data source the gallery is connected to this form control if i was to select a specific record in the gallery.

The form control now will showcase the data related to the selection that the user makes in the gallery and the form mode is set to view mode so the user cannot make any changes.

To make modifications there is an edit icon right here if the user selects this the form now becomes editable if the user selects any other record the same process would follow.

If the user wants to create a new record they'll click on the plus icon the four mode changes the default selection of the gallery goes away key thing to note that all of this is.

Happening in the same screen experience so let's see how we can build an experience like this from scratch first i need the gallery to showcase the data from my sharepoint list.

My sharepoint list is already connected to my power app you can head over to data go to add data connect to sharepoint connect to your sharepoint site and select that list.

Posts Related:

    I will go ahead and insert a vertical

    Gallery control the data source for this gallery control would be my sharepoint list the gallery control by default will have.

    The first item in the gallery selected the gallery control has a property called template fill we will add a formula to check if the item is selected and if it is we will.

    Give it a different template fill color if this item dot is selected then.

    Let's give it a color else we keep the original template fill color we can see how the first item in the gallery has a different template fill.

    Color that is applied since that is the selected item of this gallery if i was to preview the app and select a different item the template fill would be applied accordingly.

    Next we will add the edit form control go to insert forms select the edit form the data source will be the same.

    Sharepoint list this will go ahead and add the columns from my sharepoint list in here i can head over to edit fields reorder the columns.

    Define the type of control for example description is multi-line text so i can change that specific columns that i do not want to.

    Showcase on the form i can remove it and so and so forth our goal is to connect the form control to the gallery control the form control has a property called.

    Item

    Here we need to give the context of a specific record in the data source that is connected to the form control and this reference we will give as the.

    Selected item of the gallery control my gallery control i have renamed to gal inspection so the item property of the form would be.

    Gal inspection dot selected the moment i do that the form control will showcase the selected item of the.

    Gallery let's preview the app let's select the home inspection we can see this in action right here the default mode for the form control is.

    Set to edit basically the user is editing the record that is selected in the gallery the user needs to be provided with an option to submit the changes.

    To do that we will insert a button control i'll change the text property of the button to submit.

    And on the on select property of this button we will go ahead and submit the data in the form control the function is called.

    Submit form and here we need to give the reference of the form control my form control i have renamed to form inspection.

    So here i will go ahead and pick form inspection let's preview the app for this item let's make a change i'll change the subtitle from summertime.

    To summer and i will click submit the moment i do that we can see the change has been reflected in the gallery that means it has gone ahead and made.

    The modification for that item in my backend data source as well which in this case is my sharepoint list now the form control allows me to make changes to an item.

    But i want to also give the ability to the user to create new inspection items to do that i will add a button i've changed its text to new inspection when the user selects this button i.

    Would want the behavior of the form to change to a new item form on select of the button i will use the formula reset form.

    The name of my form which is form inspection and then change the mode of the form to new form the function is.

    New form and then provide the context of the form which is my form inspection if i preview the app and click on new inspection.

    The form behavior now changes to a new item form experience i've gone ahead and filled this form out and if i click on submit it will once again submit the data in the form to my.

    Data source in this case it will create a new record in my sharepoint list once i click submit the moment i hit submit the form control now shows the first item in the gallery.

    Which is selected and the new record that i created which was site inspection that's right here at the bottom to show the latest modified items right.

    At the top for the items property of the gallery i can use the sort function on my sharepoint list sort this by modified date.

    In descending order so this will now have my latest item right here on the top so user can create a new inspection or user can select an existing.

    Inspection now observe when i click on the new inspection button the form changes to new mode however when i make a selection in the.

    Gallery it is not changing the mode of the form to edit so now we need to take an extra step to do that since we are trying to reuse the form control for both the new and edit.

    Experience for the gallery control there's a property called on select we will take that step to change the mode of that form.

    First we will reset the form and then we will set the mode of the form to edit by calling the edit form function now if i make a selection of a gallery.

    Item the mode of the form will change to edit so it showcases that specific item if we click on new it changes the mode of the form to new.

    There is still a confusing aspect for the user visual indicator for the user is that lawn inspection is selected but they are creating a new inspection.

    So we would like this selection to go away by default a gallery always has an item selected so how do we go about changing that.

    Behavior the gallery control has a property called default it's set to empty if i change this.

    To an empty record observe the moment i do that it doesn't highlight any item in the gallery that means currently the gallery has no.

    DISCLAIMER: In this description contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission. This helps support the channel and allows us to continuetomake videos like this. All Content Responsibility lies with the Channel Producer. For Download, see The Author's channel. The content of this Post was transcribed from the Channel: https://www.youtube.com/watch?v=HHXKfB1iAH4
Previous Post Next Post