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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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