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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with UpdateIf fun...
Power Apps
Answered

Help with UpdateIf function

(0) ShareShare
ReportReport
Posted on by 664

I am trying to get all records on a certain date (date only field) with a certain status (text field) and update the status. There are multiple dates to update at once and there may be multiple records per date.

To get the dates where statuses should be updated, I have a collection I'd like to loop through to get all matching values and then update status.

Here is what my formula looks like right now. VisitsToRemove is the collection of dates and I have verified dates are being added (using a gallery). Meetings is the entity name. For the filter, I'd like to update all records that match the date value and whose statuses are not upcoming or pending and then set the appointment status to closed. I have used the filter portion in a gallery with a typed out date and did get expected record set. However, I don't know how to try to work out why a variable date portion is not working so does anyone see any errors with this or have a better way to go about this?

 

ForAll(
 VisitsToRemove,
 UpdateIf(
 Meetings,
 And(
 'Meeting Date' = Value,
 Not(pre_appointmentstatus = "Upcoming"),
 Not(pre_appointmentstatus = "Pending")
 ),
 {pre_appointmentstatus: "Closed"}
 )
);

 

There are no errors in the formula or after I click the button with formula, it's just that records are not updating with Closed status

Categories:
I have the same question (0)
  • Verified answer
    Cooper01 Profile Picture
    664 on at

    After not being able to get UpdateIf to work I changed out the structure to create a collection of matching record GUIDs instead of dates to get meetings by. On the button click, I iterate through each guid and patch the status update. I feel like this is less efficient than using the UpdateIf but I ran out of things to try with that

    ForAll(
     MeetingGUIDssToRemove,
     Patch(
     Meetings,
     LookUp(
     Meetings,
     Meeting = Value
     ),
     {pre_appointmentstatus: "Removed"}
     )
    );

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard