Power Apps ForAll Function: Real-World Examples

If you’ve been working with Power Apps Collections, you’ve probably hit that moment where you need to do something to every single item in your list. Maybe you need to update prices, change statuses, or send notifications to multiple users at once. That’s where the ForAll function becomes your best friend.

Let me walk you through everything you need to know about ForAll, with examples that you can actually use in your apps today.

Power Apps ForAll Function

Power Apps ForAll() function lets you perform an action on every item in a collection or table. Think of it like this: instead of writing the same code 50 times for 50 items, you write it once, and ForAll handles the rest.

Here’s the basic structure:

ForAll(YourCollection, YourFormula)

That’s it. A simple concept, but incredibly powerful when used properly.

Difference Between Power Apps ForAll and Other Functions

Before we dive into examples, let me clear up some confusion. A lot of people mix up ForAll with Filter or LookUp. Here’s the deal:

  • Filter: Finds specific items that match your criteria
  • LookUp: Finds one specific item
  • ForAll: Does something to every item (or filtered items)

ForAll is about action. You’re making changes, creating new data, or performing operations across your entire dataset.

Power Apps ForAll Function Examples

Let’s discuss some real use cases for the ForAll() function in Power Apps.

Example 1: Create Multiple Records From a Power Apps Collection

Let’s say you have a Power Apps collection containing product details as shown below, and you want to add each item present in the collection to a SharePoint list with a single button click.

ClearCollect(
    ProductsCollection,
    {
        ID: 1,
        ProductName: "Laptop",
        Category: "Electronics",
        Price: 50000,
        Stock: 10,
        LastUpdated: Today()
    },
    {
        ID: 2,
        ProductName: "Office Chair",
        Category: "Furniture",
        Price: 8000,
        Stock: 25,
        LastUpdated: Today()
    },
    {
        ID: 3,
        ProductName: "Wireless Mouse",
        Category: "Electronics",
        Price: 1200,
        Stock: 50,
        LastUpdated: Today()
    },
    {
        ID: 4,
        ProductName: "Desk",
        Category: "Furniture",
        Price: 15000,
        Stock: 5,
        LastUpdated: Today()
    }
)

Then, add the following code to the Power Apps Button control.

ForAll(
    ProductsCollection,
    Patch(
        Products,
        Defaults(Products),
        {
            Title: ThisRecord.ProductName,
            Category: {Value: ThisRecord.Category},
            Price: ThisRecord.Price,
            Stock: ThisRecord.Stock,
            LastUpdated: ThisRecord.LastUpdated
        }
    )
)
powerapps forall patch

What’s happening here:

  • ForAll loops through each item in ProductsCollection
  • For each item, it uses Patch to add a new record in the data source

Important note: ThisRecord refers to the current item in the loop. It’s like saying “this specific product we’re looking at right now.”

Example 2: Updating Multiple Items at Once In Power Apps

Now, we will use the same Power Apps collection we created earlier to update all product prices at once, increasing each price by 10%.

This is useful when a business needs to apply a bulk price change to multiple items instead of editing each product individually.

ForAll(
    ProductsCollection,
    Patch(
        Products,
        LookUp(Products,ProductName = ThisRecord.Title),
        {
            Price: ThisRecord.Price * 1.10
        }
    )
)
powerapps forall patch lookup

This updates each item’s price by 10% in the SharePoint list; you can even compare it with the previous example values.

Example 3: Building a New Power Apps Collection from Existing Data

In many real-world apps, data coming from SharePoint isn’t always in the format you want for display. Instead of modifying the source, a common approach is to create a new collection with transformed and user-friendly data.

Let’s say you have a SharePoint list called Employees with the following columns:

powerapps forall thisrecord

Now, instead of using raw SharePoint list data directly, we’ll transform employee records into a clean, app-friendly format.

We’ll extract data from the Employees list (columns like Title, LastName, StartDate, Department, Salary) and reshape it into a new collection that’s easier to display and work with in the UI.

ClearCollect(
    FormattedCollection,
    ForAll(
        Employees,
        {
            FullName: ThisRecord.Title & " " & ThisRecord.LastName,
            JoiningDate: Text(ThisRecord.StartDate, "[$-en-US]dd-mmm-yyyy"),
            Department: ThisRecord.Department.Value,
            AnnualSalary: "₹ " & Text(Value(ThisRecord.Salary), "[$-en-US]#,##0"),
            Experience: DateDiff(ThisRecord.StartDate, Today(), TimeUnit.Years) & " yrs"
        }
    )
)

This creates a brand new collection with formatted data. Notice how we’re:

  • Combining first and last names
    • Creates a single FullName field for display
  • Formatting the joining date
    • Converts StartDate into a readable format like “15-Jan-2022”
  • Handling Choice column (Department)
    • Extracts the actual value using .Value
  • Formatting salary for display
    • Adds currency symbol and proper number formatting (₹ 50,000)
  • Calculating experience dynamically
    • Uses DateDiff() to show how long the employee has been with the company
powerapps forall multiple actions

Example 4: Sending Notifications to Multiple Users In Power Apps

This one’s super practical. You need to notify a group of people about something:

ForAll(
    ApproversList,
    Office365Outlook.SendEmailV2(
        ThisRecord.Email,
        "Action Required: Review Request",
        "Hi " & ThisRecord.Name & ", You have a new request waiting for your review."
    )
)

Each person in the ApproversList gets a personalized email. The function goes through each record and sends an individual message.

Example 5: Power Apps Conditional Updates Based on Item Properties

Let’s get a bit more sophisticated. You want to update records, but only certain fields based on conditions:

ForAll(
    Filter(TasksCollection, Status = "Overdue") As CurrentTask,
    Patch(
        Tasks,
        LookUp(Tasks, TaskID = CurrentTask.TaskID),
        {
            Status: { Value: "Critical" },
            NotificationSent: true,
            LastUpdated: Now()
        }
    )
)
powerapps forall based on conditions

This checks each task and updates only the ones that are overdue. The If statement inside ForAll gives you that control.

Example 6: Deleting Multiple Items In Power Apps

Need to clean up your data? ForAll works with Remove too:

ForAll(
    Filter(TempRecords, CreatedDate < Today() - 30),
    Remove(TempRecords, ThisRecord)
)

This removes all records older than 30 days. The Filter narrows down which items to process, then ForAll removes each one.

deleting multiple items using power apps forall function

Common Mistakes to Avoid

Mistake 1: Using ForAll When You Don’t Need It

If you’re just filtering or looking up data, you don’t need ForAll. It’s for when you need to perform actions or create new data.

Mistake 2: Not Using Delegation Properly

ForAll doesn’t delegate well with large SharePoint lists. If you’re working with more than 2,000 items, you need to think about your strategy differently. Consider using Power Automate for bulk operations on large datasets.

Mistake 3: Forgetting ThisRecord

Inside ForAll, you must use ThisRecord to reference the current item. If you forget it, your formula won’t know which item you’re talking about.

Mistake 4: Performance Issues

Running ForAll on 500 items with complex Patch operations? Your app will slow down. For large operations, consider running them in the background or using Power Automate instead.

Power Apps Tips for Better Performance

Here are some practical tips I’ve learned the hard way:

Keep It Simple: The more complex your ForAll formula, the slower it runs. Break complex operations into multiple steps if needed.

Use Variables: If you’re referencing the same value multiple times, store it in a variable first:

Set(TodaysDate, Today());
ForAll(
    Collection,
    Patch(Source, ThisRecord, {LastChecked: TodaysDate})
)

Limit Your Dataset: Use Filter before ForAll to process only what you need:

ForAll(
    Filter(AllRecords, Status = "Active"),
    // your operation here
)

Test with Small Collections: Before running ForAll on your entire dataset, test it with 5-10 items to make sure your logic is correct.

Debugging Power Apps ForAll Functions

When things go wrong (and they will), here’s how to troubleshoot:

Use Notify to Check Progress:

ForAll(
    Collection,
    Notify("Processing: " & ThisRecord.Name, NotificationType.Information)
)

Collect Results to Review:

ClearCollect(
    Results,
    ForAll(
        Collection,
        {
            ItemName: ThisRecord.Name,
            Success: !IsError(Patch(Source, ThisRecord, {Updated: true}))
        }
    )
)

This creates a collection showing which items succeeded and which failed.

When to Use Power Automate Instead

Sometimes, ForAll isn’t the right tool. Use Power Automate when you need to:

  • Process thousands of records
  • Schedule regular bulk updates
  • Handle operations that take more than a few seconds
  • Work around delegation limits
  • Need better error handling and logging

Conclusion

I hope you found this article helpful. In this guide, I explained how the ForAll function works in Power Apps. I also shared simple, practical examples to help you better understand it. These examples show how to easily work with multiple records.

If you are working with data, ForAll can save a lot of time. You can use it to update records, process data, and avoid repetitive code. Try these examples in your own apps and adjust them as needed.

Also, you may like:

>

Live Webinar: Build an IT Help Desk App using Power Apps and Power Automate

Join this free live session and learn how to build a fully functional IT Help Desk application using Power Apps and Power Automate—step by step.

📅 29th Apr 2026 – 10:00 AM EST | 7:30 PM IST

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…