Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Create PDF's with specific user info from different sources

JTB76
8 - Asteroid

Hi All - Been racking my brains for a while on this one and tried several different methods....Just about pulling what hair I have left out!

 

OK, so in my flow (which is somewhat large), I create 4 different PDF documents:  Doc 1 contains information A, Doc 2 Contains information A and B, Doc 3 contains information C and Doc 4 contains information D.  Doc 1 and 2 contain similar data fields, but 3 and 4 are completely different.  It is possible that a Recipient in Doc 1 is also in all the other docs, only some of them or just 1.

 

I have these 4 flows going into a Summarize tool, which Groups Recipient, Recipient Email, Filepath and Text.  This then feeds to the email tool where I attach the correct filepath etc..

 

What is happening though is that when the emails are sending, it is sending individual emails to the recipients with 1 PDF file.  What I need to happen is twofold:

 

1.  Where there is a recipient in more than one of the documents, I want it to just send 1 email

2.  If the recipient is location in 3 PDF's, I dont want 3 PDF's attached to the email, but rather 1 PDF with the 3 documents shown.

 

Is this possible?

 

Unfortunately due to company restrictions I cant supply screenshots of data, but if any further information is needed I will try my best to supply / explain.

 

Thanks in advance

16 REPLIES 16
MattBSlalom
11 - Bolide

A screenshot of your workflow (specifically the PDF & Email sections) would probably help my understanding, but hopefully this will be helpful anyway.

 

In my sample, I'm creating 4 datasets.  Each one uses a Table tool from the Reporting tool Palette configured to "Group By" the Recipient field.  This results in generating a Table per DataSet per Recipient.

 

Then use a Union to bring all those Tables together for use in a Layout tool from the Reporting tool Palette.  The Layout tool is configured for Layout Mode "Each Group Of Records" with the Recipient field selected in the "Group By" list.  The Layout Configuration setting for Orientation is set to "Vertical with Section Breaks".  This will result in 1 record per Recipient with a Layout object that contains all the relevant Table objects associated to that Recipient.

 

Then a Render tool is used to create the PDF files.  The Output Mode is set to "Choose a Specific Output File" with the Output File path set to a location & generic PDF name.  Finally, the "Group Data Into Separate Reports" option is checked within the Render tool, the Recipient field is selected as the "Field To Group On", and the "Modify Filename By" is set to (in my sample) "Appending Group To Filename".  This results in each Recipient having a single PDF file generated that contains all relevant dataset tables associated with the given Recipient.

 

MattBSlalom_0-1619642558956.png

 

 

 

JTB76
8 - Asteroid

Hi Matt!  You have no idea how appreciative I am......It worked like a treat, so thanks!

 

I do have another, smaller issue with the same flow.  Managed to take a screenshot of this (Only one of the flows for reference).

 

I need to be able to add a header to each table that is being compiled into the one PDF so that it is easy to distinguish between the different tables.

 

I tried to do this as per attached, but when it comes to the Layout tool, I can only choose either the Table or the Header......I need both.  Do I need to put the header somewhere else?  THanks

MattBSlalom
11 - Bolide

The Report Header tool is really used for a File/Document level header; something that's repeated on each page.  I think what you're looking for is just to add a title above each of the Tables.

 

For that we'll just use the Report Text tool instead.  After setting them up for each table, we'll add a Layout tool per Table & title Text where we specify to arrange those 2 objects Vertically with the Text first, then the Table.  Now, the results heading into the Union are 1 Layout object (containing the Title & Table) per dataset per recipient.  Updated sample workflow attached.

 

MattBSlalom_0-1619722002596.png

 

JTB76
8 - Asteroid

Cheers Matt...Hopefully final question......The text for each section is being placed underneath table when I need it above each one.  I thought it was just a case of selecting the 'Place Annotation on the Top' option, but that doesn't work.

MattBSlalom
11 - Bolide

In the 4 Layout tools, it's just a matter of reordering the fields in the "Per Row Configuration" with the Up/Down arrows.

 

MattBSlalom_0-1619725121575.png

 

JTB76
8 - Asteroid

Wow!  Simple solution and never saw it!  Thanks again Matt for all your help.

 

Might be reaching out to you in the future!

 

Thanks again.

JTB76
8 - Asteroid

Hi Matt - Just wondering if you might be able to help again.  Management are asking for a few additional adds to the PDF's and one of them is to not only have the PDF with the data, but also to have the tables included in the body of the email.  How can I do this, as I am also using a text tool to add generic wording in the email?  Thanks

MattBSlalom
11 - Bolide

It sounds like you already have your Email tool configured to use a field for the Body of the email, so that's good.  It sounds like all you want to do is drop in that current email body text on top of the final Layout tool that we're also rendering out for the attachments.

 

So, when we add the email body Report Text tool after the final Layout tool, we can use the option "Attach text to existing field" in the Report Text tool.  Select the field that has that final Layout, and set the Position of the email body Report Text to be "Place text above existing object".

 

*Side note:  This could also have been a method to handle adding the "titles" to your datasets previously instead of creating the title as a new field & using a Layout tool to stack the title & table.  Similarly, we could follow the same approach described at that point for your email body; adding it as a separate field instead of attaching to an existing field, and using a Layout tool to stack the email body text on top of the data tables/titles layout.

 

Then update your Email tool for the Body to use the appropriate Layout field instead of just the Report Text field you had previously.

 

 

MattBSlalom_0-1620763004655.png

 

JTB76
8 - Asteroid

Hi Matt - Should have added this first, but I have tried to do as per your flow but getting a few issues.  I think its because my Vertical Layout Tool goes into the Render tool to create my PDFs.  Just before the Layout tool, I have another flow going down to add in email address / contacts and then do my Text Layout which goes on into the Email Tool.

 

When I tried to bring the flow down after the Vertical Layout tool, it started throwing me up errors.

Labels