web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set the status to requ...
Power Apps
Suggested Answer

Set the status to request processed once all items in gallery processed

(0) ShareShare
ReportReport
Posted on by 531
I have a power apps gallery where items will be routed for approval. The status should be updated as request processed once all the items in the gallery is either approved or rejected. i.e. when the approver actions the last item, status should be updated as request processed. May I know how to achieve this?
 
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    5,036 Super User 2025 Season 2 on at
     
    Try this formula
     
    Created a gallery like this using the sample collection
     
    ClearCollect(
        ColApprovalReq,
        {
            ID: 1,
            RequestID: "REQ-2023-001",
            RequestDescription: "Laptop replacement for new hire",
            Assignee: "SR",
            Status: "Pending"
        },
        {
            ID: 2,
            RequestID: "REQ-2023-002",
            RequestDescription: "Software license renewal",
            Assignee: "SR",
            Status: "Pending"
        },
        {
            ID: 3,
            RequestID: "REQ-2023-003",
            RequestDescription: "Office chair replacement",
             Assignee: "SR",
            Status: "Pending"
        },
        {
            ID: 4,
            RequestID: "REQ-2023-004",
            RequestDescription: "VPN access request",
             Assignee: "SR",
            Status: "Approved"
        },
        {
            ID: 5,
            RequestID: "REQ-2023-005",
            RequestDescription: "Email distribution list creation",
             Assignee: "SR",
            Status: "Rejected"
        },
        {
            ID: 6,
            RequestID: "REQ-2023-006",
            RequestDescription: "Conference room AV setup",
              Assignee: "SR",
            Status: "Pending"
        }
    )
     
     
    Color Property ( Condition Checks) - Repeat it for reject too
     
    If(ThisItem.Status = "Pending",Color.Blue,Color.Green)
     
     
    Display Mode Property
     
     
     
    Placed one button like this
     
    Display Mode (Button will be clickable if all actions are taken)
     
    If(
        CountRows(
            Filter(
                (Gallery1.AllItems),
                Status = "Approved" || "Rejected"
            )
        ) = 0,
        DisplayMode.Edit,
        DisplayMode.Disabled
    )
     
    On Select 
     
    If(
        CountRows(
            Filter(
                (Gallery1.AllItems),
                Status = "Approved" || "Rejected"
            )
        ) = 0,
        ForAll(
            Gallery1.AllItems,
            Patch(
                ColApprovalReq,
                LookUp(
                    ColApprovalReq,
                    RequestID = ThisRecord.RequestID
                ),
                {Status: "Request Processed"} // In code i set it as Closed modified according to your logic.
            )
        )
    )
     
     
     
     
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
     
     
     
     
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Could be something like this if I am understanding what you are asking
    I am presuming that this is some type of collection that you are using to update a data source and you don't want to perform any updates until each item is approved or rejected 
     
     
    If(
        CountRows(Filter(Gallery1.AllItems, isBlank(Action) )) = 0, 
        ForAll(
        Gallery1.AllItems,
        Patch(
            YourDataSource,
            ThisRecord, 
            {
                Action: ThisRecord.Action,
                Status: "Request Processed"
            }
        )
    )
     
    Syntax is not quite correct
     
    You are constantly checking that the action column is completed for every row in the gallery.
    When they are all completed loop through the gallery and update the data source with the action and status column values.
     
    You have to decide where you will execute the code 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 740 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 342 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard