Navigation, add, update & delete

Power Apps Navigation and CRUD Operations

Objective

Create a Power App that allows users to:

  1. Navigate between screens.

  2. Update existing records.

  3. Delete records.

  4. Refresh the data to reflect changes.

App Structure

We will create the following screens:

  • HomeScreen — Gallery view to list all records.

  • EditScreen — Form view to update selected records.

Data source used in this example: 'expense-items' (can be any table from SharePoint, Dataverse, or Excel)

1 Navigation Between Screens

A. Create Screens

1.From the left panel, click on Screens > New screen > Add:

  • HomeScreen

  • EditScreen

B. Home Screen

  1. On HomeScreen, add a Gallery (Insert > Gallery > Vertical).

  2. Set the Items property of the Gallery:

    'expense-items'
    
  3. Add filtering using a text input (txtSearch):

    Filter(
        'expense-items',
        Email.Email = User().Email &&
        (IsBlank(TextInput.Text) || StartsWith(Text(Amount), TextInput.Text))
    )
    

    or

    Filter(
        'expense-items',
        Email.Email = User().Email &&
        (IsBlank(TextInput1.Text) || Amount = Value(TextInput1.Text))
    )
    
  4. Set the OnSelect property of the Next arrow icon:

    Navigate(EditScreen, ScreenTransition.Fade);
    EditForm(ExpenseForm);
    
  5. Set the OnSelect property of the Trash icon:

    Remove(ExpenseForm);
    
  6. Use the default Next arrow icon inside the gallery for navigation, and a trash icon to delete an expense.

C. Edit Screen

  1. On EditScreen, insert an Edit Form (Insert > Forms > Edit).

  2. Set its DataSource:

    'expense-items'
    
  3. Set its Item property:

    Gallery1.Selected
    
  4. Add a button below the form with this OnSelect:

    SubmitForm(ExpenseForm)
    
  5. After submitting, you can add this logic to navigate HomeScreen:

    If(
        ExpenseForm.Valid,
        SubmitForm(ExpenseForm);
        Navigate(HomeScreen, ScreenTransition.Cover)
    );
    

D. More Configuration in Home Screen

  1. On the HomeScreen, click the Add Expense Button.

  2. Set its OnSelect property:

    Navigate(EditScreen, ScreenTransition.Fade);
    NewForm(ExpenseForm);
    
  3. Complete the form and click the submit button.

E. Add an Edit Form

  1. Clicking the Next arrow icon in the HomeScreen gallery navigates to the EditScreen and shows the chosen item’s data in the form.

  1. On HomeScreen, add a trash icon to each item in the gallery.

  2. Set the icon’s OnSelect:

    Remove('expense-items', ThisItem)
    

Sometimes you want to manually refresh the data:

  • Add a Refresh button on any screen with:

    Refresh('expense-items')
    

This ensures the latest data is pulled from the source.

Additional Tips

Auto Navigate After Delete:

If you delete from the EditScreen, use:

Remove('expense-items');
Navigate(HomeScreen, ScreenTransition.Cover)

SubmitForm Success Notification:

Use the form’s OnSuccess property:

Notify("Record updated successfully!", NotificationType.Success)

Summary

Suggested Enhancements

  • Add a Create screen (NewForm) for adding new records.

  • Use Patch() for complex updates.

  • Customize the form layout for better UX.

© 2025, Attosol Private Ltd. All Rights Reserved.