top of page

PowerApps Collection: Add, Update, and Remove a record.

PowerApps collections are a way to store and manipulate data within a PowerApps app. A collection is essentially a table of data that can be created and manipulated within an app without the need for an external data source.


In this article, we will discuss how to add an item to PowerApps Collection, how to remove an item from the PowerApps collection, and how to update collection items in PowerApps.



Collections can be used to store data temporarily within an app or to provide offline functionality for users by caching data on the device. They can also be used to combine data from different sources, perform calculations or filtering on data, or provide lookup tables for dropdown lists or other controls.


Here we have some of the benefits of PowerApps collection:

  • Allows local storage and manipulation of data within an app

  • Supports a wide range of data types

  • Enables easy data filtering, sorting, and grouping

  • Provides an efficient way to work with data in PowerApps

  • Simplifies data management and manipulation without requiring extensive coding knowledge

  • Can be used to hold data retrieved from various sources such as SharePoint lists, Excel files, or external APIs

  • Supports formulas and functions for data transformation and computation

  • Provides a flexible and scalable solution for app development.


How to add a record to PowerApps Collection

To add a new single record or multiple records to Powerapps Collection, follow the below processes.


STEP 1: Go to "Apps" and select Canvas => + New App.


STEP 2: Select "Tablet layout" under the "Blank app" section as shown in below.


STEP 3: Go to the "Insert" tab and add "Text-label".

Add four labels: Name, Age, Mobile Number and Address.




STEP 4: Now, go to the "Insert" tab and add "Text-Input".

The text input will help you to enter the data. You have to add four "text-input".



STEP 5: Now, go to the "Insert" tab and add "Button".

The button will trigger the creation of a new record in your collection. You can choose the style for your button



STEP 6: Double-click on the button and open the "OnSelect" property.


STEP 7: OnSelect property takes two arguments: the name of the collection and a record to ass to the collection.



Below is an example of adding a new record to a collection called "MyCollection".

OnSelect = Collect(CandidateInfo, {Name:I_name.Text,Id:I_age.Text,MobileNumber:I_mobile_number.Text,Address:I_address.Text})

STEP 8: Go to the View tab to add the items.



STEP 9: Now, click on collections to view the added item in Collections.



Result




How to remove a record from the PowerApps collection

If you want to remove the unnecessary items from the Powerapps Collections, then follow the following steps:


STEP 1: Go to Insert tab -> Gallery -> Vertical(Select any gallery from the drop-down).



STEP 2: Select the Collection name (CandidateInfo) from the Data source.


STEP 3: Now, go to Gallery Properties from the right side of the page. Select the Layout as the Title and subtitle.


Click on the vertical Gallery and put the below formula:

Items = CandidateInfo

Where CandidateInfo is the Collection name


When you will put the above formula, then you can see all the items that you have added in the Powerapps collection.


STEP 4: Add a Button and rename it to Clear Item. Go to Insert => Button.


This button is used to clear all the items that are present in the Powerapps Collections.


Select the button (Clear Item) and put the below formula in the formula bar:

OnSelect = Clear(CandidateInfo)

STEP 5: Now to remove an item from the Powerapps Collection, click on the "Clear Items" button. Then that item will be removed from the Gallery as well as Powerapps Collections.



How to update records in PowerApps Collections

In the Powerapps Update Function, you can use two different functions:

  • Update: Powerapps Update Function is used to replace the entire record in a data source.

  • UpdateIf: Powerapps UpdateIf Function is used to modify one single or more values in one or more records that match one or more conditions.

Update Syntax

Update( DataSource, OldRecord, NewRecord [, All ] )

Where,

  • DataSource: This contains all the records that you want to replace. It may be a Table, Collections, etc.

  • OldRecord: It is the record that you want to replace.

  • NewRecord: It is the replacement record. This is not a change record. Here, the entire record is replaced.

  • All: Mention the All argument to remove all copies of the record.


UpdateIf Syntax

UpdateIf( DataSource, Condition1, ChangeRecord1 [, Condition2, ChangeRecord2, ... ] )

Where,

  • DataSource: This data source contains one or more records that you want to modify.

  • Condition(s): In this condition, you can use the column names of DataSource in the formula. It evaluates to True for the record that you want to modify.

  • ChangeRecord(s): You can provide a change record of new property values that satisfy the condition.

Example:

In the below example, I want to update the address of all records that are present in the Powerapps Collections. Follow the below steps to do so:


STEP 1: Insert a Button ( go to Insert => Button) and rename it to Update Item.



Select the button and apply the below update formula as shown below:

OnSelect = UpdateIf(CandidateInfo, Name = Name, {Address:I_address.Text})

Where,

  • OnSelect = Property Name

  • UpdateIf = Function Name

  • CandidateInfo = Collection Name

  • Name = Text input name

  • Address = Text input name


STEP 2: In the Preview app, When you will click on the Update Item button, then the address will change in each record in the Powerapps Collections.



Conclusion

PowerApps collection is a versatile and useful feature that enables users to create complex and dynamic apps without requiring extensive coding knowledge. It simplifies data manipulation and management, allowing users to easily store, sort, and filter data. Collections provide an efficient way to work with data in PowerApps and enhance the overall app development experience.


2 Comments


Guest
Mar 26

By bringing different ideas, skills, and information to the table, a dedicated team makes sure that the final result is both unique and useful. Companies that recognize the value of a well-rounded development team include Go Wombat site. Their skill at making unique software and mobile apps shows how important it is to work together.

Like

Guest
Sep 23, 2023

"PowerApps Collection: Adding, updating and deleting entries. This tutorial is a fantastic resource for anyone who wants to master PowerApps collections and produce good written work. Step-by-step instructions make it easy to understand how to add, update, and delete entries when writing an essay. If you have difficulty in writing, then take a look at this site and write better content. If you want to improve your PowerApps skills, visit this site for detailed recommendations."


Like
bottom of page