cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Glaga
Helper I
Helper I

bulk update records

Hello,

I would like to update several recordings according to a button.

I have two lists:
JOB
> Job title
> Status_Job

CANDIDATE
> Name_Candidate
> ID_Job
> Status_Candidate

I would like that when I update the status of the post in "closed" >> That all candidate registrations with the ID of the post in the registration go to status "Refusal"

I tried :
ForAll (JOBS; Patch (CANDIDATE; LookUp (CANDIDATE; ID = ID_JOBS); {Status_candidate "Refused"}))

4 REPLIES 4
mdevaney
Super User
Super User

@Glaga 

My suggestion would be to create a Collection of all the candidates who will be refused.  Then you can loop over each candidate refused using FORALL to update their record in the Candidates table.

 

Please note: I have also excluded any candidate who was already accepted from being refused.  If you don't have that requirement please delete my code in blue.

 

ClearCollect(
    candidatesRefused;
    Filter(CANDIDATE,ID=your_ID_job;Status_Candidate<>"Accepted")
);;
ForAll(
    candidatesRefused;
    Patch(
        CANDIDATE;
        LookUp(ID=candidatesRefused[@ID]);
        {Status_Candidate="Refused"}
    )
}   

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

unfortunately it does not work ..

I think there is an error in the ForALL.

Because the collection creation works well!


here is my formula

ClearCollect(candidatesRefused;Filter(CANDIDATE; ID_JOB=ID_JOB_SELEC));;
ForAll(candidatesRefused;Patch(CANDIDATE;LookUp(CANDIDATE;ID_CANDIDATE=candidatesRefused.ID_CNADIDATE);{Etat_PP:"Refused"}))

 

@mdevaney &@all do you have any solution ? 

@Glaga 

Can you please post a screenshot of what the candidates refused collection looks like when it is 1st created and then what it looks like after FORALL?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,258)