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_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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