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
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,954)