cancel
Showing results for 
Search instead for 
Did you mean: 
Rahman1005

Execute CRUD operations within the Power Platform using a Canvas App

User story: When a new account is created, there is a requirement to execute a curd operation via Power Apps, involving updating an existing record and deleting the record from the accounts.

If we want to few complete records in accounts entity on welcome screen:

Navigate to vertical Gallery and select Items property should be Item=Accounts.

Rahman1005_0-1708329533849.png

 

 

To create a new record, one must click on the plus icon displayed on the screen and input the formula provided below, as illustrated in the following screen. This action will prompt a new screen to open for the creation of the new record.

 

Navigate(CreateScreen);ResetForm('Account Create Form')

 

Rahman1005_1-1708329533853.png

 

 

After navigating to the creation screen, a new form will be displayed, and it is necessary to configure the data source to 'Account,' as shown in the screen below.

And Items property = Defaults (Accounts)

 

Rahman1005_2-1708329533858.png

 

 

Next, upon clicking the submit button, we should save the data in the account entity and return to the main screen.

We need to write below formula on Onselect property of button in app.

SubmitForm('Account Create Form');Navigate(GridScreen)

 

 

Rahman1005_3-1708329533863.png

 

 

Next, on click on cancel button we need to navigate back main screen.

Write formula on OnSelect = Navigate(GridScreen).

Rahman1005_4-1708329533866.png

 

When the edit icon is clicked, we should navigate to the edit screen, where the editing interface will open.

Add below formula on edit icon as show in blow screens and DataSource to Accounts

OnSelect = Select(Parent); Navigate(EditScreen, ScreenTransition.Cover, {})

Rahman1005_5-1708329533868.png

 

 

Rahman1005_6-1708329533871.png

 

On Item property set AccountGrid.Selected to open selected account will open in the edit form refer below screen.

Rahman1005_7-1708329533874.png

 

 

OnSelect = SubmitForm('EditForm'), Navigate (GridScreen) When the save button is clicked, the account will be updated, and the user will be navigated back to the Main Screen.

 

Rahman1005_8-1708329533877.png

 

 

OnSelect = Navigate(GridScreen) When the Cancel button is clicked, it will navigate back to the Home grid screen.

Rahman1005_9-1708329533880.png

 

 

Next, if we wish to delete a record from the account entity, we need to apply the code below to the delete icon. This will result in the deletion of the corresponding selected record.

OnSelect = Select(Parent); Remove(Account, ThisItem);

 

Rahman1005_10-1708329533883.png

 

 

Thank you..!