Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Working with (wanted) line breaks and the Table > Email tools

Scott_Snowman
10 - Fireball

I have a workflow that pulls from SharePoint, slices into various pieces based on project owner and status, and mails out separate tables based on the project owner's email address. No problem there.

 

The issue is the formatting of the table. As noted in LisaL's comment here the Email tool does not play well with new lines in data.

 

Here's how the data flows in from Sharepoint. The "Running Update Detail" field has new lines inserted.

 

Project IDProject Start DateLast Updated DateStatusRunning Update Detail
54A10-30-1710-31-17Pending parts

10/30: Dispatch requested review of functionality. Approved by Scheduling.

10/31: Dispatched agent reported that part code #34B1-LL/A was not functioning and needed to be re-ordered

23B10-24-1710-27-17Pending Scheduling approval

10/24: Dispatch requested review of functionality.

10/24: Due to remote location, Scheduling requested extension of project timeline

10/27: Approval from finance to extend project parameters

 

I can see that Alteryx recognizes the new lines because it does flag them in the Results panes.

 

However when the data is emailed out through Alteryx, the following occurs.

 

Running Update Detail

10/30: Dispatch requested review of functionality. Approved by Scheduling. 10/31: Dispatched agent reported that part code #34B1-LL/A was not functioning and needed to be re-ordered

10/24: Dispatch requested review of functionality. 10/24: Due to remote location, Scheduling requested extension of project timeline 10/27: Approval from finance to extend project parameters

 

Since there could be multiple lines of data flowing in per cell, I don't want to split apart into unique fields as in the linked solution because I don't know how many fields I'll need. (And I'm not aware of a "futureproof" method to do it easily if there is one.)

 

Is there a way to either:

 

  • Maintain the new line formatting in the email output,
  • Selectively bold the dates that separate updates so they're easier to spot, or
  • Another way to split out the data so it's visually easy to separate?
33 REPLIES 33
patrick_digan
17 - Castor
17 - Castor

@Scott_Snowman You can use a line break tag

<br />

I ended up doing it in 2 steps- First I used a formula tool to convert the new lines to line breaks

REGEX_Replace([Running Update Detail],"\n","<br />")

Then I ran that through the table tool. The table tool will escape the < and > symbols, so then I used another formula tool after to convert it back

Replace([Table],"&lt;br /&gt;","<br />")

That seemed to do the trick for me

Capture.PNG

Hope that helps!

Scott_Snowman
10 - Fireball

Patrick, this works perfectly. As a bonus, now I see what should have been obvious: tables are passed from tool to tool as HTML strings. So I was able to both create new lines and use RegEx_Replace to insert bold and underline tags, further enhancing visibility on the date:

 

REGEX_Replace([Running Escalation Detail], "([\d]+\/[\d]+)\:", "<b><u>$1</u></b>:")

 

These additional tags needed to be replaced in the [Table] field (as with the original <br /> tag) but things look great now (literally).

 

A great opportunity for a macro solution down the line, if I am working with other datasets with this format.

 

Thanks a ton! 

 

 

bccpwc
7 - Meteor

This is actually what I'm looking to do but it doesn't work for me. I even downloaded the sample solution you posted and that doesn't work either. thoughts?

Scott_Snowman
10 - Fireball

Hi there @bccpwc, could you upload a workflow that illustrates what you're seeing? I have been using this technique just fine in my workflows since @patrick_digan clued me in, and your workflow would assist with troubleshooting.

bccpwc
7 - Meteor

@ScottS28 Well I downloaded the solution provided in the thread by Patrick above and that didn't work; I literally downloaded and ran it and it shows the br tags in the output instead of a line break. I'm using version 11.7

Scott_Snowman
10 - Fireball

@bccpwc, I realize this is a very delayed reply. My apologies!

 

I re-downloaded the workflow and ran it with no issues; after I configured the email tool to send to my own address I received the mail with no issues.

 

Is it possible you're receiving the email as a plain-text document and not an HTML view? Could you upload a screenshot of the email as you see it in your mail client?

 

I can't think of any other issue that could be causing the discrepancy in outputs.

Prasanna921
7 - Meteor

Hello Patrick,

This post is very helpful to get better understanding to solve new line characters issues using email output option. But in my requirement, I need to dump the data into powerpoint slides using render tool. I can't see any data field once after using the second formula tool for replacing (&lt;br /&gt;","<br />").

 

Can you please Help me with this ?

patrick_digan
17 - Castor
17 - Castor

@Prasanna921 Can you post an example workflow (dummy data is fine) or screenshots showing the issue you're having?

Prasanna921
7 - Meteor

In my case I need to output table into powerpoint slide. So I am using render tool to for that, but I can't see any output fields to select .

Labels