You are viewing limited content. For full access, please sign in.

Question

Question

Split Line Items in an Email readable Format

asked on June 4, 2018

Hi All,

 

 

Hope everyone is well,

 

I am trying to achieve the following:

1. When Sending an Email via Workflow, I would like to have the fields populate the body of the email in a readable manner such as:

- ItemName

- PartNumber

- TotalRequired

 

But, when trying to achieve this, I am getting them in 1 line with no spaces in them? 

i.e ItemNamePartNumberTotalRequired 

Below is what I currently have set up?

1. Create a Token Called Email Body
--> 

2. For Each Row line item, I then have the following:

 

 -->

 

-->

 

Problem is though when I test this, I get all the fields in 1 line without any spaces as per below? 

 --> 

 

Now because there are multiple lines in here, the email being sent is not coming out right. As in the formatting is not correct of course. 

 

Can anyone shed any light on this? or any other way I should be tackling this? 

 

Thank you in advance,

Ziad

0 0

Answer

SELECTED ANSWER
replied on June 4, 2018 Show version history

Hi Ziad,

 

have you tried separating the email body by applying an index? you can separate by line break in the token. Assuming that the email body token is multi value.

One way to tackle this could be similar to what you have posted above, but instead of updating the email body straight away, update temp tokens and then run a foreach value to update the email body. All of my tokens here are multivalue. There may be a better way to do this, however this was quickly thrown together :).

 

I hope this is similar to what you are after.

Edit: Just re-read what Kentaro had said, I'm pretty sure this is what he was eluding to.

Kind Regards,

Aaron

2 0

Replies

replied on June 4, 2018

I had a very similar idea as Aaron. I am assuming that you want something like:

- ItemName1

- PartNumber1

- TotalRequired1

- ItemName2

- PartNumber2

- TotalRequired2

and so on. For testing purpose, I created multi-value tokens A (with values A, B, C), B (with values D,E,F), C (with values G,H,I), and Body (empty multi-value token).

I then created a For Each Value for Token A, and within the loop created an Assign Token Value which appends to the Body Token, with new values set to below:

In the end, my Body token stored:

- A

- D

- G

- B

- E

- H

- C

- F

- I

Which is what I wanted.

 

1 0
replied on June 4, 2018 Show version history

How about creating your email body directly within the email activity? 

As long as you have the Item Name, Part Number, Total Required values stored in individual tokens (which seems to be the case at first glance), you should be able to go to Email Editor > Tokens to access them directly without having to go through all your steps. 

Either ways, I think the first step to make your life easier is to store these values in individual tokens. If, for whatever reason that's not possible, you can apply functions to your tokens to insert line breaks but I doubt you need to take that approach. If you're interested, this page on the admin guide explains how you can apply control characters to insert new line breaks. 

0 0
replied on June 4, 2018

Hi Kentaro,

 

Thanks for the quick response, 

I have tried that, but what would occur is that the line items would not be split in the email body, 

 

As in from memory if we have 2 items it would show as below in the email body:

 

ItemName1,ItemName2

PartNumber1,PartNumber2

TotalRequired1,TotalRequired2

 

Thanks

Ziad

0 0
SELECTED ANSWER
replied on June 4, 2018 Show version history

Hi Ziad,

 

have you tried separating the email body by applying an index? you can separate by line break in the token. Assuming that the email body token is multi value.

One way to tackle this could be similar to what you have posted above, but instead of updating the email body straight away, update temp tokens and then run a foreach value to update the email body. All of my tokens here are multivalue. There may be a better way to do this, however this was quickly thrown together :).

 

I hope this is similar to what you are after.

Edit: Just re-read what Kentaro had said, I'm pretty sure this is what he was eluding to.

Kind Regards,

Aaron

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.