community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More

Emailing Different Reports to Different Recipients

Moderator
Moderator
Created on

Question

If I have a workflow that creates a set of data by region, how can I group the data by region and then send each region's data separately to each of the region's Vice President, all within one workflow?

Answer

There are several ways to do this, depending on what form you want the reports to take. The attached workflow, created in 10.6, gives you three examples as described below. Please note that you will need to populate the second Text Input Tool and the "From" in the Email Tool with valid email addresses in order to test.

 

1. Include Data as a Table within the Body of Email

If you are dealing with a small set of records and columns, this might be your best bet. This approach will insert a table into the body of the email, giving the recipient immediate access to the data without having to open an attachment.

TableInEmailBody - Workflow.png

 

The email will look similar to this:

 

TableInEmailBody.png

 

2. Create Flat Files and Attach to Emails

This option is best if you simply need to send specific datasets to specific recipients and the report doesn't require any formatting. Here, you are simply creating files names based on Region, writing out the data by Region (using the "Take File/Table Name From Field" option in the Output Data Tool), and then summarizing the recipient and file name data so that only one email is sent per group.

 

AttachFlatFile - Workflow.png 

The Excel files will look like this:

 

AttachFlatFile.png

  

3. Create a Formatted Excel Table and Attach to Email

This one is similar to the previous workflow, except we are creating a formatted table using the Table Tool, and then writing out the table to Excel using the Render Tool, in order to keep the formatting. In the Render Tool, we are using the "Group Data Into Separate Reports" feature.

 

AttachFormattedTableFile - Workflow.png

In this example, the Excel files will look like this:

 

AttachFormattedTableFile.png

 

I hope you will find this useful for your use case. Thank you for reading!

 

Attachments
Comments
Atom

Disregard my question, I didn't realize I could download the workflow. Thx

Moderator
Moderator

No worries, @jcooz! Sorry that I didn't respond to your question earlier, but I just returned today from being OOO for the last two weeks. Happy Alteryxing!

Asteroid

thanks for sharing !!

I have an additional question.

How could I manage it, when a user runs this manually on a Alteryx Server. The user which started the workflow needs to enter an individual e-mail adress to which the output should be sent. 

I think about a dynamic input tool where the e-mail adress will be entered, this will be joined with the dataset ....

 

If no email is entered the dataset should be available for download at the end.

 

Would something like this possible ?

 

thanks in advance

 

Steffen

Moderator
Moderator

Hi @vizda,

 

According the requirements you laid out, it sounds like the best route would be to convert this to an Analytic App by introducing a Text Box Interface tool to allow the user to enter an email address. The likely setup is that you would have a Text Input tool that would get updated by the Text Box tool. For the second part, to make the report available for download if no email is provided, you can use a detour that is updated based on whether or not an email is provided. You could have one side of the detour feed the emailing part of the workflow and have the other side feed the download option. Each stream would be identical except for the part that either emails or creates the file.

 

Another option is to use Radio Buttons to allow the user to choose between providing an email address or downloading the report. When the user chooses one option, let's say the email option, the Radio Button would activate the tools within one Container box that emails the report. When they select the other Radio Button, that would activate another Container box that downloads the report. Both Container boxes would be disabled by default and the Radio Button would activate a particular box.

 

Here are some links to help get you started:

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/How-To-Properly-Use-A-Detour-Tool-In-An-Anal...

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/CS-Macro-Dev-Detour-Tool-Alternative-Tool-Co...

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/CS-Macro-Dev-Conditional-Processing-with-Det...

 

A helpful sample workflow can be found here: Help > Sample Workflows > User scripting and automation tools > Build an app > Clean and Parse Phone Numbers

 

Thanks!

Asteroid

Hi @DanC

 

I tried making this work with my company's server. Everything runs fine but the email tool errors out with a 'Blank' error. There is no error message being displayed except for "Record#1." 

I am confused on what's happening here. Did you face this anytime?

 

Thanks, 

Amar

Moderator
Moderator

Hi @Amarendra,

 

When you say you tried getting the workflow to work on your company's server, do you mean that you tried to upload the workflow to the Gallery and run it from there or that you tried to run it from the Designer on the server itself? Also, were you able to get it to work on your desktop version of Designer? Finally, are you able to get a simple workflow that doesn't attach any files and simply sends an email to work either locally or on the server?

 

Thanks!

Asteroid

I meant using my Company's email server.

I use parallels on a Mac and I had this weird blank error everytime I run the workflow, the same workflow would work on a PC.

I updated to 2018.2 yesterday and it seems to be working for me now.

 

I am not entirely sure if 11.7 had any bug with the email tool. 

 

Thanks, 

Amar

Asteroid

@DanC 

I'm attempting to use the render tool following 4 separate visual layouts.

The 4 reports appear correct in the "Manage Layout", so now I need to turn them into 1 PDF file with the 4 reports on their own pages.

We'll call the sections/headers:

Picking

Packing

Receiving

Putaway

 

In the "Manage Layout" tool, each has an image, date, and header, and I need to maintain all of this.

Essentially, the recipient should be able to just print the PDF and get 4 separate pages, each with the report as it appears in the Layout Manager.

As I try this, I either lose sections, or all sections become combined without the appropriate headers (just one long table of data, with the image and header only on the first page).

I've tried multiple configurations in the Join Multiple and Render tools, to no avail. Your help is appreciated!

Asteroid

For reference to anyone facing this same challenge, here is the solution I discovered:

 

I connected each of the visual layout tools to a multi join tool. Then I used one layout tool set to pull in each individual record (checking boxes for the 4 layouts I was using), vertical with section breaks.

 

I then used another layout tool, for all records combined, vertical section breaks, and Layout as the data field in the per section configuration.

 

The result is perfect -- the render tool gives me a PDF file with each of the four reports cleanly on their own pages in the file. Very clean, ready to email, print, and post to our warehouse bulletin boards.

Meteoroid

@DanC 

Thanks for your explanation.

 

If I have already prepared several tables/data on excel sheet, and also listed out different recipients, and need to send those table separately to different recipients, do you have any advice?

 

So in this situation, I would like to keep the greeting words and ending sentences the same for all emails, the only difference would be the content of table, (and those table would have the same headings/columns/rows) and then different distribution lists.

 

Would it be a way to extract the table out of the excel and then input different email address to the email output?

 

Great thanks.