Hello,
I'm trying to set up a script wich iterates values in a Lookup field with multiple entries.
I have 2 forms:
Werkopdracht
wich contains the lookup field medewerkers_select
Medewerkers
wich holds the field Voornaam (text single line) wich is related to the lookup field in the Werkopdracht form
and has a field wich contains and email field; email_medewerker
I want to send any individual selected person in medewerkers_select and email when the Werkopdracht form in succesfully submitted.
I tried using the tutorials and examples on the Zoho help docs, but nothing seems to work. The only thing i have achieved is sending every person in the Lookup field a email.
It seems to throw an error when i try to add crtiteria to the for each function.
How can i achieve this?
heres the code:
- for each medewerkers_select r in WerkOpdracht [medewerkers_select == input.ID]
- {
- temp = input.medewerkers_select.toString();
- rec = medewerkers_form [voornaam_medewerker == temp];
- sendmail
- (
- To : rec.email_medewerker
- From : zoho.adminuserid
- Reply to : "email adress hidden"
- Subject : input.Projectnaam + " - " + input.projectnummer + " - " + input.Datum + " - Toegewezen"
- Message : "<div>Planning heeft een nieuwe werkopdracht toegewezen. </div><div>Voor meer info, zie PDF</div>"
- Attachments : template:Werkopdracht as PDF
- )
- }
greets.