We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Two inputs-Send Email even if 1 input doesn't have data

Gurinder27
7 - Meteor

I have two input files from the same source, saved in the download folder, with different file names but the same format. I want the workflow to continue even if one of the inputs is empty. After processing the inputs, a table and report text and layout tool will follow. I'll send you a screenshot.

The goal is to include both tables in a single email. The email should say: "Hi, please add the following to the primary data and the following to the secondary data." If the secondary input file is missing, the email should still be sent without errors, only showing: "Hi, please add the following to the primary data," and vice versa. Is this achievable?

4 REPLIES 4
flying008
15 - Aurora

Hi, @Gurinder27 

 

Anyway, does your email want to contain any attachments? If so, how many attachments are there in each of the two cases?

Gurinder27
7 - Meteor

No attachments

only body of the email with tables or table

flying008
15 - Aurora

Hi, @Gurinder27 

 

Since you did not provide a screenshot of the expected output email template, I can only briefly explain the key points of the process.


1- Merge data sources.
Due to the possibility that one of the two data files you need to input may be missing, you need to use the FileExists (Path) function to check if the file exists and use a batch macro to input the existing file data. I am not sure if the file may not exist in the scenario you described, or if it exists but its data may only have a title without any records, so it cannot be expanded.


2- Create email body.
Please watch the animation of the workflow. The most crucial part here is the CrossTab+Formula tools, which combines to generate dynamic email body. The judging condition is the number of your records, and then the Union tool is used to create a complete body in String+Table format.


3- Send email.
This step does not require any skills, you can operate according to your own settings.

 

BTW, Due to security policy restrictions, I am unable to upload any workflow files, so please watch the animation.

 

Spoiler
'Hi, please ' + 
(IF [Primary_Data]!= 0 && [Secondary_Data]!= 0 
THEN 'add the following to the primary data and the following to the secondary data.' 
ELSEIF [Primary_Data]!= 0 && [Secondary_Data]= 0  
THEN 'add the following to the primary data.' 
ELSEIF [Primary_Data]= 0 && [Secondary_Data] != 0  
THEN 'add the following to the secondary data.' 
ELSE 'check if the 2 input files are valid.' 
ENDIF) + 
'<br /><br />'

录制_2025_02_27_15_54_44_288.gif

 

If the second input file doesn't have data. 

 

录制_2025_02_27_16_17_10_156.gif

 

Gurinder27
7 - Meteor

Thanks for the help and i will attempt it and share the feedback

Labels
Top Solution Authors