CRUD Operations using Power Apps

If you are a Power Apps beginner or are trying to implement some practical operations, then you should read this crud operations using PowerApps tutorial.

This Power Apps tutorial covers the Canvas app Form CRUD Operations in Power Apps and different types of Power Apps screens.

Furthermore, we will discuss how to submit the Power Apps form to a SharePoint Online list.

CRUD Operations in Power Apps

In Power Apps, we will perform some Create, Read, Update, and Delete (CRUD) operations on Power Apps forms. Power Apps form CRUD operations allow users to create, read, update, and delete forms in Power Apps.

Example:

I have created a SharePoint Online list named “Employee Registration“. This list contains the below fields.

Column NameData Type
First NameIt is a default single line of text; I just renamed it as “First Name”
Last NameA single line of text
GenderChoice
Phone NumberNumber
EmailSingle line of text
DOBDate and Time
Power Apps Form CRUD Operations

Now, I want to create a Power Apps Canvas app with four different screens, i.e., [EmployeeBrowseScreen], [CreateNewEmployeeScreen], [EmployeeDetailsScreen], and [EditEmployeeScreen] by using “Form CRUD Operations”.

crud operations using powerapps

To achieve the above example, follow the steps below. Such as:

Employee Browse Screen

1. Open Power Apps with your valid Microsoft 365 credentials -> Create Blank Canvas app -> Connect to the respective SharePoint Online list like below.

crud operations using power apps

2. Select a default screen -> Rename it as “EmployeeBrowseScreen” -> Insert a Gallary control and set its Items property as:

Items = 'Employee Registration'

Where,

  • ‘Employee Registration’ = SharePoint Online List
power apps form crud operations

3. Insert the Add icon and set its OnSelect property code like below.

OnSelect = NewForm(frm_NewEmployee);
Navigate(
    CreateNewEmployeeScreen,
    ScreenTransition.None
)

Where,

  • NewForm = This function changes the Form control’s mode to FormMode.New
  • frm_NewEmployee = Power Apps Form Name
  • Navigate = This function can be used to redirect to other screens
  • CreateNewEmployeeScreen = Name of the Second Screen
crud operations in powerapps

4. Select the Next arrow icon (>) and set its OnSelect property as:

OnSelect = Navigate(
    EmployeeDetailsScreen,
    ScreenTransition.None
)

Where,

  • EmployeeDetailsScreen = Third Screen Name
crud operations in power apps form

5. Insert an Edit icon inside the gallery and set its OnSelect property code as:

OnSelect = Navigate(
    EditEmployeeScreen,
    ScreenTransition.None
)

Where,

  • EditEmployeeScreen = Fourth Screen Name
crud operations from power apps form

6. In the last, insert a Trash icon and set its OnSelect property as:

OnSelect = Remove(
    'Employee Registration',
    ThisItem
)

Where,

  • Remove = This function helps us to remove a specific record or records from a data source
  • ‘Employee Registration’ = SharePoint Online List
  • ThisItem = Selected SharePoint List Item
CRUD Operation in Power Apps

Create New Employee Screen

7. Next, add a new screen -> Insert an Edit form (frm_NewEmployee) and set its DataSource and Default mode properties:

DataSource = 'Employee Registration'

Default mode = New
CRUD Operation in Power Apps Canvas app

8. Now, insert a Save icon and set its OnSelect property as:

OnSelect = SubmitForm(frm_NewEmployee);
ResetForm(frm_NewEmployee)

Where,

  • SubmitForm = This function is used to save any changes in a form control to the data source
  • frm_NewEmployee = Power Apps Form Control Name
  • ResetForm = This function can help us to reset the contents of a form control
how to create power apps form crud operations

9. Similarly, insert a Back arrow icon and set its OnSelct property as:

OnSelect = Navigate(EmployeeBrowseScreen)
create power apps form crud operations

Employee Details Screen

10. Next, add another screen -> Insert a Display form (frm_EmployeeDetails) and set its DataSource property as:

DataSource = 'Employee Registration'
Power Apps Form CRUD Operations in Canvas app

11. Also, if you want to Read the specific record from the data source, then select the Item property as:

Item = gal_Employee.Selected

Where,

  • gal_Employee = Gallery Control Name
Power Apps Form CRUD Operations from Canvas app

Edit Employee Screen

12. In the last, add another screen -> Insert an Edit form (frm_EditEmployee) and set its DataSource property as:

DataSource = 'Employee Registration'
CRUD Operations in Power Apps

13. And, if you want to Update the specific record from the data source then, select the Edit Form’s Item property as:

Item = gal_Employee.Selected
CRUD Operations in Power Apps Canvas app

14. Then, insert a Save icon and set its OnSelect property as:

OnSelect = SubmitForm(frm_EditEmployee);
ResetForm(frm_EditEmployee)
How to Manage a Power Apps Canvas app Form CRUD Operations

15. Our Power Apps app is now ready to use. Save, publish, and preview the app as in the screenshot below.

how to use power apps form crud operations

This is all about the Power Apps Form CRUD operations.

Submit Power Apps Form to SharePoint Online List

Let’s see how to submit the Power Apps form data to the SharePoint Online list.

16. Open the Power Apps Home page -> Select the Apps section -> Click on the respective app, i.e., [Power Apps Form CRUD Operations] -> Select the Play icon under the More commands () option like below.

Submit Power Apps Form in SharePoint List

17. When the user opens the app, an EmployeeBrowseScreen appears. Once the user clicks on the Add icon (+), he or she is redirected to the second screen, the [CreateNewEmployeeScreen], to add a new record.

how to use crud operations in power apps form

18. The user will enter a new record via the Power Apps Form and click on the Save icon. Once he/she submits the record, the new record will be submitted in the SharePoint Online list (Employee Registration) as shown below.

Manage Power Apps Canvas app Form CRUD Operations

19. Also, if you want to Read the Employee details then, click on the View icon in the EmployeeBrowseScreen, and it will redirect to the third screen, i.e.,[EmployeeDetailsScreen], like below.

Submit Power Apps Form to SharePoint Online List

20. Suppose the user wants to update or edit an existing record. In this case, they should click on the edit icon in the EmployeeBrowseScreen, which will redirect them to the fourth screen (EditEmployeeScreen).

Submit Power Apps Form to SharePoint List

21. In the last, if you want to Delete the respective record then, click on the Trash icon in the EmployeeBrowseScreen as in the screenshot below.

Submit Power Apps Form Data to SharePoint Online List

This is how to submit Power Apps Form Data to the SharePoint Online list.

Conclusion

Now, you will get to know about crud operations in PowerApps. We saw how to insert, update, delete, and view items from the SharePoint list using Power Apps.

You may like the following tutorials: