Help with format of string content

Bidduam
Tera Guru

I've managed with help to convert list collector values to a string, but I can't seem to get some email addresses to present the way they do to be read in the notification in order to be sent, would love some help please.

 

So currently the email addresses are being presented as so:

'zxy@email.com', 'abc@email.com', 'plo@email.com'

What I need it to look like is the same thing without the  ' ' around the addresses:

zxy@email.com, abc@email.com, plo@email.com 

 

The script I have for adding the values to the flow variable is:

 

var add_list = fd_data.flow_var.add_user_list;

if (add_list == '')
    add_list = '\'' + fd_data._15__look_up_record.record.email.toString()+ '\'';
else
    add_list += ',\'' + fd_data._15__look_up_record.record.email.toString() + '\'';
return add_list

 

 

@Ankur Bawiskar 

1 ACCEPTED SOLUTION

Bidduam
Tera Guru

@Ankur Bawiskar & @Sandeep Rajput 

 

I have actually managed to get it 'working' with the following code:

var add_list = fd_data.flow_var.add_user_list;

if (add_list == '')
    add_list = fd_data._15__look_up_record.record.email.toString();
else
    add_list += ', ' + fd_data._15__look_up_record.record.email.toString();

return add_list;

 

The email logs also show that it appears to work:

Bidduam_0-1741059885518.png

 

Bidduam_1-1741059898836.png

 

But none of the emails were received at all by the recipients and our infrastructure guys have confirmed that it was never received in our organisation.

 

Any ideas?

View solution in original post

11 REPLIES 11

Bidduam
Tera Guru

@Ankur Bawiskar & @Sandeep Rajput 

 

I have actually managed to get it 'working' with the following code:

var add_list = fd_data.flow_var.add_user_list;

if (add_list == '')
    add_list = fd_data._15__look_up_record.record.email.toString();
else
    add_list += ', ' + fd_data._15__look_up_record.record.email.toString();

return add_list;

 

The email logs also show that it appears to work:

Bidduam_0-1741059885518.png

 

Bidduam_1-1741059898836.png

 

But none of the emails were received at all by the recipients and our infrastructure guys have confirmed that it was never received in our organisation.

 

Any ideas?

@Bidduam 

if email shows sent in email logs then no issue from ServiceNow.

Is email sending enabled?

Same recipients received emails from instance earlier?

Check with the mailbox team.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Yeah emails work for all other items, the same notification was being received earlier in the day without issue when it only had one recipient working.

 

Now no one is getting the email, not the user in the to field, or those in the CC field

 

Checked with the mailbox team, the email is not hitting our gateway at all. We are using the ServiceNow email for sending from ServiceNow

@Bidduam 

so is that flow logic working when 1 recipient is present?

What if with 2 recipients?

I could see in image the recipients are there as comma separated so ideally it should work fine.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

It would appear it might be an issue with our ServiceNow notifications as a whole, I've logged a support ticket.

 

No one has received any notifications for hours, so it's not just my one I've been working on. 

 

As always thanks for your help 😁