= getdistinctusers(topeople(cons!IP_GRP_ALERTS)), a!queryRecordType( recordType: 'recordType!{3a27d5e6-31ce-4fe1-995f-821c7e573c8a}IP Add Details.fields.{7340349a-5cf6-4b92-a093-9d1d261d7be2}candidateMail', fields: 'recordType!{3a27d5e6-31ce-4fe1-995f-821c7e573c8a}IP Add Details.fields.{7340349a-5cf6-4b92-a093-9d1d261d7be2}candidateMail', filters: a!queryFilter( field: 'recordType!{3a27d5e6-31ce-4fe1-995f-821c7e573c8a}IP Add Details.fields.{7340349a-5cf6-4b92-a093-9d1d261d7be2}candidateMail', operator: "=", value: true ), pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 500) ).data
I am using the send email smart service and i used the "topeople" function to send the email to the group members first and then again i used the "user()" function to return a specific info from a field. Is this the correct way ?
Discussion posts and replies are publicly visible
What do you want to achieve? You are sending an email to a member of the alerts group. Do you also need to include the output of the queryRecord type?
i also want to send an email to a person who is related to the user of the alerts group.
Like to put it short, i have a select candidate button and when i click on it, the recruiter who added the candidate details and the candidate need to get a mail.
so i used the group function in the first line and then i used the user function to retrieve the candidate data.I think i might be doing it wrong so just wanted to verify it.
skzahed_09 said: recruiter who added the candidate details and the candidate need to get a mail.
Just to clarify more,You need to send an email to recruiter and candidate only?Where are you storing recruiter and candidate information?
I would recommend you to use toUser() in both places and combine the result and use that in email recipient.
Shubham Aware said:Where are you storing recruiter and candidate information?
Iam storing the recruiter and candidate value in a record table field and i have separate and unique ID's given to them so i am retrieving the data of the candidates and recruiter from the record table.
I see few issues with this expression. There are two outputs here
1. from expression getdistinctusers(topeople(cons!IP_GRP_ALERTS)),
2. from the query record type
An expression should have one output so you need to concat the results.
Another issue is your field "candidateMail". You are filtering to find records where this field has value as true(). The output of this queryrecord() will be true or null only depending on data. It won't return any username or email address.
So check the query record expression in a separate expression and tweak it until it returns the data you need here. Secondly put a concat outside the two expressions (getdistinctusers() as well as query record output).
Also, if you are passing the constant containing group in it you don't need a topeople() function. getdistinctuser will give the expected output.
As you are sending email to recruiter and candidate we need userId of those or direct emailId of those.Which one do you have?