Remove and RemoveIf functions in Power Apps - Power Platform (2024)

  • Article
  • 6 minutes to read

Removes records from a data source.

Description

Remove function

Use the Remove function to remove a specific record or records from a data source.

For collections, the entire record must match. You can use the All argument to remove all copies of a record; otherwise, only one copy of the record is removed.

RemoveIf function

Use the RemoveIf function to remove a record or records based on a condition or a set of conditions. Each condition can be any formula that results in a true or false and can reference columns of the data source by name. Each condition is evaluated individually for each record, and the record is removed if all conditions evaluate to true.

Remove and RemoveIf return the modified data source as a table. You can use both functions only in behavior formulas.

You can also use the Clear function to remove all of the records in a collection.

Delegation

When used with a data source, these functions can't be delegated. Only the first portion of the data source will be retrieved and then the function applied. The result may not represent the complete story. A warning may appear at authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible. For more information, see the delegation overview.

Syntax

Remove( DataSource, Record1 [, Record2, ... ] [, All ] )

  • DataSource – Required. The data source that contains the record or records that you want to remove.
  • Record(s) – Required. The record or records to remove.
  • All – Optional. In a collection, the same record may appear more than once. You can add the All argument to remove all copies of the record.

Remove( DataSource, Table [, All ] )

  • DataSource – Required. The data source that contains the records that you want to remove.
  • Table – Required. A table of records to remove.
  • All – Optional. In a collection, the same record may appear more than once. You can add the All argument to remove all copies of the record.

RemoveIf( DataSource, Condition [, ... ] )

  • DataSource – Required. The data source that contains the record or records that you want to remove.
  • Condition(s) – Required. A formula that evaluates to true for the record or records to remove. You can use column names from the DataSource in the formula. If you specify multiple Conditions, all must evaluate to true for the record or records to be removed.

Examples - single formulas

In these examples, you'll remove a record or records in a data source that's named IceCream and that starts with the data in this table:

Remove and RemoveIf functions in Power Apps - Power Platform (1)

Create a collection with sample records

To create a collection with this data:

  1. Insert a Button control.

  2. Set button control's OnSelect property to the below formula:

    ClearCollect( IceCream, { ID: 1, Flavor: "Chocolate", Quantity: 100 }, { ID: 2, Flavor: "Vanilla", Quantity: 200 }, { ID: 3, Flavor: "Strawberry", Quantity: 300 })
  3. Select the button while holding down the Alt key:

Remove sample records from collection using a formula

FormulaDescriptionResult
Remove(IceCream,
LookUp(IceCream,Flavor="Chocolate"))
Removes the Chocolate record from the data source.Remove and RemoveIf functions in Power Apps - Power Platform (2)

The IceCream data source has been modified.

Remove(IceCream,
LookUp(IceCream,Flavor="Chocolate"), LookUp(IceCream,Flavor="Strawberry") )
Removes two records from the data source.Remove and RemoveIf functions in Power Apps - Power Platform (3)

The IceCream data source has been modified.

RemoveIf(IceCream, Quantity>150 )Removes records that have a Quantity that's greater than 150.Remove and RemoveIf functions in Power Apps - Power Platform (4)

The IceCream data source has been modified.

RemoveIf(IceCream, Quantity>150, Left(Flavor,1) = "S" )Removes records that have a Quantity that's greater than 150 and Flavor starts with an S.Remove and RemoveIf functions in Power Apps - Power Platform (5)

The IceCream data source has been modified.

RemoveIf(IceCream, true )Removes all records from the data source.Remove and RemoveIf functions in Power Apps - Power Platform (6)

The IceCream data source has been modified.

Examples - remove button outside a gallery

In this example, you'll use a Gallery control to list the records in a table. And then use the Remove function to selectively remove an item.

Prepare for sample data

This example uses the Contacts table in Microsoft Dataverse available with the sample apps and data. You can deploy sample apps and data when you create an environment. You can also use any other data source instead.

Remove button outside a gallery

In this example, you'll remove an item by using a button that is outside the gallery.

  1. Create a new blank canvas app using a Phone layout.

    Remove and RemoveIf functions in Power Apps - Power Platform (7)

  2. Select the Insert from the left pane.

  3. Select Vertical gallery.
    A Gallery control is be added to your screen.

    Remove and RemoveIf functions in Power Apps - Power Platform (8)

  4. You're prompted to select a data source where you can select a data source from the available data sources.
    For example, select the Contacts table to use sample data:

    Remove and RemoveIf functions in Power Apps - Power Platform (9)

    The gallery shows items from this table:

    Remove and RemoveIf functions in Power Apps - Power Platform (10)

  5. Insert a Button control from left pane:

    Remove and RemoveIf functions in Power Apps - Power Platform (11)

  6. Move the added button below the gallery items:

    Remove and RemoveIf functions in Power Apps - Power Platform (12)

  7. Update button text property to Remove record. You can also use text of your choice:

    Remove and RemoveIf functions in Power Apps - Power Platform (13)

  8. Set the OnSelect property for this button control to the following formula:

    Remove( Contacts, Gallery1.Selected )

    Remove and RemoveIf functions in Power Apps - Power Platform (14)

    The gallery control makes the currently selected record available using Selected property. Remove function refers to this selected record to remove it.

  9. Preview the app using the Play button on the top right, or press F5 on keyboard:

    Remove and RemoveIf functions in Power Apps - Power Platform (15)

  10. Select a record to remove, such as Nancy's record in this example:

    Remove and RemoveIf functions in Power Apps - Power Platform (16)

  11. Select Remove record:

    Remove and RemoveIf functions in Power Apps - Power Platform (17)

    Selecting the button removes the selected record (in this example, Nancy's record).

  12. Close the app preview.

    Tip

    You can also use alternate behavior with Alt key instead of using the app preview with Play button or F5.

Examples - trash can icon inside a gallery

In this example, you'll remove an item by using an icon placed inside the gallery.

Create a collection with sample data

If you already have prepared sample data, skip this step and move to Trash can icon inside a gallery.

  1. Add a Button control to your screen.

  2. Set the OnSelect property to the following formula:

    ClearCollect( SampleContacts, { 'Full Name': "Yvonne McKay (sample)", 'Primary Email': "someone_a@example.com" }, { 'Full Name': "Susanna Stubberod (sample)", 'Primary Email': "someone_b@example.com" }, { 'Full Name': "Nancy Anderson (sample)", 'Primary Email': "someone_c@example.com" }, { 'Full Name': "Maria Campbell (sample)", 'Primary Email': "someone_d@example.com" }, { 'Full Name': "Robert Lyon (sample)", 'Primary Email': "someone_e@example.com" }, { 'Full Name': "Paul Cannon (sample)", 'Primary Email': "someone_f@example.com" }, { 'Full Name': "Rene Valdes (sample)", 'Primary Email': "someone_g@example.com" })
  3. Select the button while holding down the Alt key.

Sample collection is created that you can use in the following example.

Trash can icon inside a gallery

  1. Create a new blank canvas app using a Phone layout.

    Remove and RemoveIf functions in Power Apps - Power Platform (18)

  2. Select the Insert from the left pane.

  3. Select Vertical gallery.
    A Gallery control is be added to your screen.

    Remove and RemoveIf functions in Power Apps - Power Platform (19)

  4. You're prompted to select a data source where you can select a data source from the available data sources.
    For example, select the Contacts table to use sample data:

    Remove and RemoveIf functions in Power Apps - Power Platform (20)

    If you created a collection, select your collection instead:

    Remove and RemoveIf functions in Power Apps - Power Platform (21)

  5. Select a control within the top item in the gallery.

    To ensure next step inserts item into gallery's template and not outside the gallery, ensure you follow this step before moving to the next step.

    Remove and RemoveIf functions in Power Apps - Power Platform (22)

  6. Select Add icon from left pane.

    Remove and RemoveIf functions in Power Apps - Power Platform (23)

    Note

    Add icon inserts a + icon on the left side of the gallery, replicated for each item in the gallery.

  7. In the top item, move the icon to the right side of the screen.

    Remove and RemoveIf functions in Power Apps - Power Platform (24)

  8. Select the Icon property for icon and set it to the following formula to update the icon image as trash icon:

    Icon.Trash

    Note

    The Icon. prefix is only shown when you're actively editing the formula.

    Remove and RemoveIf functions in Power Apps - Power Platform (25)

  9. Set the OnSelect property to the following formula:

    Remove( [@Contacts], ThisItem )

    Note

    You must use global disambiguation operator [@...] in this example with sample data that uses the Contacts table to avoid conflict with a One-to-Many relationship. If you use data sources such as a list or a SQL Server table, using global disambgulation operator is not required.

    Remove and RemoveIf functions in Power Apps - Power Platform (26)

  10. Preview the app using the Play button on the top right, or press F5 on keyboard.

  11. Select the trash icon next to a record, for example Maria's:

    Remove and RemoveIf functions in Power Apps - Power Platform (27)

    The record is deleted:

    Remove and RemoveIf functions in Power Apps - Power Platform (28)

  12. Close the app preview.

Remove and RemoveIf functions in Power Apps - Power Platform (2024)

FAQs

What is the difference between the remove () function and the RemoveIf () function? ›

Remove Function – Use the Remove function to remove & delete a specific record or records from a data source in Microsoft Power Apps. RemoveIf Function- Use the RemoveIf function to remove & delete a record or records based on a condition or a set of conditions in Microsoft Power Apps.

How do you clean Power Apps collections? ›

The Clear function deletes all the records of a collection. The columns of the collection will remain. Note that Clear only operates on collections and not other data sources. You can use RemoveIf( DataSource, true ) for this purpose.

What does the remove () method do? ›

The remove() method takes a single element as an argument and removes it from the list. If the element doesn't exist, it throws ValueError: list.remove(x): x not in list exception.

What is the functionality of the remove () method? ›

The remove() method removes the first occurrence of the element with the specified value.

How do I remove duplicates from a collection power app? ›

PowerApps Remove Duplicate in a Collection
  1. Get Distinct (Collection Name is colSample) ClearCollect( colDistinct, Distinct( colSample, CreatedDate. ) ); Output for the above command.
  2. Clear the collection before collect. Clear(colFinal);
  3. Loop through the Distinct collection and get the first item from the main collection.
Aug 7, 2021

How do I clear the power app cache? ›

Steps to Clear Cache while Working with Power Apps Portals
  1. Sign in to the Dynamics 365 portal as an administrator. [Portal User With Administrator role inD365] ...
  2. Navigate to the URL as follows: /_services/about.
  3. After this, the portal details page will be open. Click on the Clear Cache button to clear the cache.
Jun 15, 2021

What is the difference between collect and ClearCollect in Power Apps? ›

With a single function, ClearCollect offers the combination of Clear and then Collect. ClearCollect returns the modified collection as a table. ClearCollect can only be used in a behavior formula. I hope this helps you!

How do I manually delete apps and features? ›

  1. Select Start , then select Settings > Apps > Apps & features.
  2. Select the app you want to remove, and then select Uninstall.

What is another button for Delete? ›

The ALT + BACKSPACE keyboard shortcut replaces the DELETE key and now that I know about it, I use it quite often. ALT + BACKSPACE, as I mentioned, is DELETE—that is, delete the NEXT letter after the cursor.

How do I delete unwanted app data? ›

Delete unused apps and free up space
  1. On your Android device, open Files by Google .
  2. At the bottom left, tap Clean .
  3. If you don't find "Delete unused apps" card, scroll to "Free up more space" card and tap Search for apps.
  4. On the confirmation dialog, tap Continue.
  5. On the “Usage access” screen, tap Files by Google.

How do I uninstall unwanted objects app? ›

Simply upload your image, find the object removal tool, resize the brush, and paint over your unwanted objects. Then, leave the rest to Fotor, which will remove the object in seconds and blend the photo nicely to make it look more natural. Try it out!

How do I delete multiple records in Power Apps? ›

Insert the button or the Trash icon and on the icon add “OnSelect” - Remove(test123,Gallery1_1. Selected). Your items will be deleted.

What is the difference between remove () and empty () methods? ›

empty() will empty the selection of its contents, but preserve the selection itself. remove() will empty the selection of its contents and remove the selection itself.

What is the difference between remove () and empty () methods *? ›

remove() – Removes all child elements with selected element. In this method you can restore all data but not event handlers of removed elements from the DOM. All data and events related with elements will be removed. empty() – Removes all content and child elements from the selected element.

What is the major difference between pop () and remove ()? ›

Array elements can be removed using pop() or remove() method. The difference between these two functions is that the former returns the deleted value whereas the latter does not. The pop() function takes either no parameter or the index value as its parameter.

Which function is used to remove an Object? ›

The delete operator removes a property from an object.

Can we use remove function in string? ›

Remove(Int32, Int32)

Returns a new string in which a specified number of characters in the current instance beginning at a specified position have been deleted.

What is the syntax of remove () a file? ›

remove() Following is the syntax of remove() function. If the file is present, remove() function deletes the file. But, if the file is not present, remove() function throws FileNotFoundError.

How do you use distinct function in Power Apps? ›

Example
  1. Insert a Button control, and set its OnSelect property to this formula. ...
  2. Select the button while holding down the Alt key. ...
  3. Insert a Data table control, and set its Items property to this formula: ...
  4. Use the Edit fields link in the data table's properties pane to add the Result column:
Dec 15, 2022

How do I get distinct values in Power Apps? ›

Distinct – unique values in Power Apps
  1. Insert a ComboBox control. As items you can simply use a column, but then these items are seen duplicated:
  2. So let´s use the Distinct to wrap the column.
  3. now you only see the list of unique values:
  4. Leave a Reply. Your email address will not be published. Δ

How do I filter and remove duplicates? ›

To filter for unique values, click Data > Sort & Filter > Advanced. To remove duplicate values, click Data > Data Tools > Remove Duplicates. To highlight unique or duplicate values, use the Conditional Formatting command in the Style group on the Home tab.

Does clearing app cache delete everything? ›

Tip: Clearing the cache simply clears temporary files. It won't erase login credentials, downloaded files, or custom settings.

Does clearing app cache delete data? ›

Clear the app cache files of any app you think is causing performance issues, or delete app data for any apps you want to open with a clean slate. You'll get some storage space back, but nothing you've downloaded will be deleted. Depending on the app, user data such as your preferences or search history may be reset.

What are the two types of PowerApps? ›

There are two main types of Power Apps: Canvas apps and Model-driven apps. Previously, Power Apps Portals would have fallen under this category. Microsoft have since released Power Pages, a standalone product that has evolved from the functionality of Power Apps Portals.

How many collections can you have in PowerApps? ›

Power Apps collections are limited to a size of 2,000 records unless you know the special techniques needed to go past that number. This is because the ClearCollect and Collect functions can only return as many records as the delegation limit allows.

Can we refresh collection in PowerApps? ›

If you only want to "refresh" the collection, you can add a button, copy the original formula that create that collection and paste OnSelect of the button. In Power Apps Canvas apps, refreshing a collection means to create the collection again.

How do I clean up apps and features? ›

  1. Open the Start menu and select Settings > Apps > Apps & features. Open Apps & features settings.
  2. Search for a specific app or sort them by size to see which ones are taking up the most space.
  3. When you find an app you want to delete, select it from the list, and then select Uninstall.

How to uninstall a program that does not appear in Control Panel? ›

Check for the uninstallation file in the Program Folder

In case that the software is not listed in Control Panel, navigate to the folder of the program you are trying to uninstall and run the uninstall.exe file. This should remove the program from your PC.

How do I remove all registry entries from a program? ›

Open the Registry Editor by selecting Start, Run, typing regedit and clicking OK. Navigate your way to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall. In the left pane, with the Uninstall key expanded, right-click any item and select Delete.

How do I add custom action buttons? ›

Select Settings | Custom Actions. Select Create. Then give your custom action button a name and select whether you want the button to appear on selected base objects and on desktop and mobile apps.

How do I change my power button actions? ›

Select Search on the taskbar, type control panel, and select it from the results. Select System and Security. In the Power Options section, select Change what the power buttons do. Select Change settings that are currently unavailable.

How do I edit an action button? ›

Tap at the top to go to your Page. Tap below your cover photo. Tap Edit Action Button, then tap Edit buttons. Choose a button to show on your Page.

What are the two ways to delete? ›

Both the Del or Delete key and Backspace key are used to delete text.

Which option is used to delete? ›

Pressing Delete (DEL) also deletes the currently highlighted text, image, or group of images. To delete all text in a text file, you can use the shortcut key to select all text which is Ctrl + A . Once all text is highlighted press the Del or Backspace to delete all highlighted text.

What is the control shortcut for delete? ›

Copy, paste, and other general keyboard shortcuts
Press this keyTo do this
Ctrl + D (or Delete)Delete the selected item and move it to the Recycle Bin.
Ctrl + EOpen Search (in most apps).
Ctrl + R (or F5)Refresh the active window.
Ctrl + YRedo an action.
47 more rows

What happens if you clear data on an app? ›

Clear cache: Deletes temporary data. Some apps can open slower the next time you use them. Clear data storage: Permanently deletes all app data. We recommend trying to delete from inside the app first.

Can I clean up app data? ›

While the cache can be cleared with little risk to app settings, preferences, and saved states, clearing the app data will delete/remove these entirely. Clearing data essentially reset an app to its default state: it makes your app act like when you first downloaded and installed it.

What is remove permissions and free up space? ›

“Remove permissions and free up space” is now “pause app activity if unused.” What you're “pausing” is now mentioned in the description. 7:12 PM · May 11, 2022. 1. 104.

How do I remove an object from a list of objects? ›

There are three ways in which you can Remove elements from List:
  1. Using the remove() method.
  2. Using the list object's pop() method.
  3. Using the del operator.
Jul 13, 2022

Which tool is used to remove unwanted objects from an image? ›

Use the Healing Brush tool if you need more control

With the Healing Brush tool, you manually select the source of pixels that will be used to hide unwanted content. In the Toolbar, press the Spot Healing Brush tool and select the Healing Brush tool from the pop-out menu.

What is object erase? ›

When taking pictures, sometimes unwanted objects may also be captured in the photo. At that time, using the Object eraser tool, you can easily remove the unwanted people or objects immediately on your Galaxy smartphone. The Object eraser tool can be found in Labs in the photo album.

How do you clean PowerApps collections? ›

The Clear function deletes all the records of a collection. The columns of the collection will remain. Note that Clear only operates on collections and not other data sources. You can use RemoveIf( DataSource, true ) for this purpose.

How do you multi select and delete? ›

Click on one of the files or folders you want to select. Hold down the control key (Ctrl). Click on files or folders that you want to select while holding the control key. Continue to Hold down the control key until you select all the files you want.

What is difference between remove () and empty ()? ›

The empty() method removes all child nodes and content from the selected elements. Note: This method does not remove the element itself, or its attributes. Tip: To remove the elements without removing data and events, use the detach() method. Tip: To remove the elements and its data and events, use the remove() method.

How does removeIf work in Java? ›

removeIf will go through each element in your list and run the specified predicate (boolean function) on it. If the predicate returns true , it will be removed from the list. If the predicate returns false , it will not. In your case, every element will result in the predicate returning true , thus clearing the list.

What is use of remove () in ArrayList? ›

The remove() method removes the single element from the arraylist.

Which command is used to remove an empty? ›

Use the rmdir command to remove the directory, specified by the Directory parameter, from the system. The directory must be empty (it can contain only . and ..) before you can remove it, and you must have write permission in its parent directory.

Which command can be used to remove a non empty? ›

To remove a directory that is not empty, use the rm command with the -r option for recursive deletion.

What are the two methods for removing items from a list? ›

The methods are remove(), pop() and clear(). It helps to remove the very first given element matching from the list. The pop() method removes an element from the list based on the index given. The clear() method will remove all the elements present in the list.

What is the difference between the Remove object obj and remove int index methods? ›

The remove(int index) method accepts the index of the object to be removed, and the remove(Object obj) method accepts the object to be removed.

How to remove items from a list Java? ›

There are two remove() methods to remove elements from the List.
  1. E remove(int index ) : This method removes the element at the specified index and returns it. The subsequent elements are shifted to the left by one place. ...
  2. boolean remove(Object o ) This method removes the first occurrence of the specified Object .
Aug 3, 2022

How to remove an object from list in Java based on condition? ›

To remove elements from ArrayList based on a condition or predicate or filter, use removeIf() method. You can call removeIf() method on the ArrayList, with the predicate (filter) passed as argument. All the elements that satisfy the filter (predicate) will be removed from the ArrayList.

How to remove list of objects from another list in Java? ›

There are two ways to remove objects from ArrayList in Java, first, by using the remove() method, and second by using Iterator. ArrayList provides overloaded remove() method, one accepts the index of the object to be removed i.e. remove(int index), and the other accept objects to be removed, i.e. remove(Object obj).

How do I remove duplicates from an ArrayList? ›

Approach:
  1. Get the ArrayList with duplicate values.
  2. Create another ArrayList.
  3. Traverse through the first arraylist and store the first appearance of each element into the second arraylist using contains() method.
  4. The second ArrayList contains the elements with duplicates removed.
Dec 11, 2018

Is Remove from list the same and delete? ›

Remove from list is for removing follow up flags from flagged email messages. If you delete the flagged message from tasks, you delete the flagged message from your mailbox. Was this reply helpful?

Can we use Remove function in string? ›

Remove(Int32, Int32)

Returns a new string in which a specified number of characters in the current instance beginning at a specified position have been deleted.

Top Articles
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 6680

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.