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"}))
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"}))
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?
User | Count |
---|---|
157 | |
91 | |
80 | |
74 | |
57 |
User | Count |
---|---|
197 | |
166 | |
99 | |
95 | |
79 |