Is this the correct way to send an mail.

Certified Associate Developer

As shown in the above image i have a record table and from this record table i have to retrieve the fields recruiter and candidateID so i can send e-mails to them.

This was my code for retrieving the data from the fields and then sending them automated emails. But, i am not getting any mails. Can anyone please help me about where i went wrong so i can rectify it.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    your filter code is wrong. 

    field should not have pv!record. It should be just IP Add Details.recruiter , 

    value should have pv!record. So if recruiter columns stores recruiter record then value should be pv!record[IP Add Details.recruiter]. If you understand the code you would want system to filter the rows in record where recruiter field in record matches with provided recruiter value. So value should have pv and field should not! 

    One question I have is the field IP Add Details.recruiter - > what data is in this field? 

    On another note, Is the recruiter id same as recruiter's username in appian? If yes can you replace the lines 5-16 with the below expression and try. 

    toemailaddress(pv!record[IP Add Details.recruiterId])

  • 0
    Certified Associate Developer
    in reply to Harsha Sharma
    One question I have is the field IP Add Details.recruiter - > what data is in this field?

    The recruiter field has the recruiters data like (Recruiter ID, Name, Mail, Phone, DOB)

  • 0
    Certified Lead Developer
    in reply to skzahed_09

    so you mean its a relationship. If thats the case you need to have code like below after correcting the "field" and "value" configurations. 

    toemailaddress(pv!record[IP Add Details.recruiter.mail)

    - please adjust the field name as per exact filed name that you have! 

  • 0
    Certified Associate Developer
    in reply to Harsha Sharma

    No no its not a relationship. It is a user. Iam using an userpicker object in the interface to select a recruiter from the existing user i already have in appian.

    And now in the process model, Iam retrieving the 2 fields candidateID and the recruiter so that i cant send mails to both of them.

  • 0
    Certified Lead Developer
    in reply to skzahed_09

    Did you try putting your second "toemailaddress()" with the internal "a!queryRecord().data" into an empty expression rule editor to see what its output would be? 

    My first guess is that the result will be nonsensical, because the result of that query expression as-written will not possibly result in an email addresss (and all "toemailaddress()" does is take an email address as text and convert it to the "Email Address" data type for use in the send e-mail smart service).

  • 0
    Certified Lead Developer
    in reply to skzahed_09

    Query entity’s field attribute should have the record field reference which stores email of recruiter. As Mike suggested, test the query entity’s field attribute independently in an expression rule to verify data returned by it and adjust code to achieve recruiter email!

    The recruiter field has the recruiters data like (Recruiter ID, Name, Mail, Phone, DOB)

    Also, in your process model can you see the data correctly for candidateMail field in the process variable? 

Reply
  • 0
    Certified Lead Developer
    in reply to skzahed_09

    Query entity’s field attribute should have the record field reference which stores email of recruiter. As Mike suggested, test the query entity’s field attribute independently in an expression rule to verify data returned by it and adjust code to achieve recruiter email!

    The recruiter field has the recruiters data like (Recruiter ID, Name, Mail, Phone, DOB)

    Also, in your process model can you see the data correctly for candidateMail field in the process variable? 

Children
No Data