Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Email the Attachments Based on Email Body Contents

KamenRider
11 - Bolide

Hi,

 

I would like to ask your help in regards to sending the email with attachments and below is the conditions.

 

1. If the 2 files has data, both will be attached to the email with email body contents:

    2 files completed with Data

 

2. If the Student Name.xlsx has data and Student Score has no data, both files will attached with email body contents:

   a. Student Name completed

   b. Student scores has no scores

 

3. If the Student Name.xlsx has no data and Student Score has data, both files will attached with email body contents:   

    a. Student Name has no data

   b. Student scores completed

 

4. If both files has no data, both files will be attached in the email with email body contents:

   2 files has no data

 

Attaching the sample files for your reference. Hoping to see you inputs on how this will be done.

 

Thanks,

Kamen

10 REPLIES 10
Yoshiro_Fujimori
15 - Aurora

Hi @KamenRider ,

 

Please check if the attached workflow works.

(You need to switch the input file manually to check all the patterns.)

I hope this helps.

 

As the text with multiple lines did not show properly on Report Text Tool,

I added some logic to keep the new lines in the message.

If you do not care, you can remove Text To Columns tool and Summarize tool.

 

Workflow

1283911_Workflow.png

 

Formula Tool

IF [Count_Name] != 0
THEN
  IF [Count_Score] != 0
  THEN
"2 files completed with Data"
  ELSE
"a. Student Name completed
b. Student scores has no scores"
  ENDIF
ELSE
  IF [Count_Score] != 0
  THEN
"a. Student Name has no data
b. Student scores completed"
  ELSE
"2 files has no data"
  ENDIF
ENDIF

KamenRider
11 - Bolide

Hi @Yoshiro_Fujimori 

 

This is great!.. now my problem is how will the workflow be able to attached the attachments. Those files with data are being save in the "With Data" folder while the excel files with no data are retain outside the "With Data" folder. The reason why it is being save to another folder because a new column is being added for the remarks. So for example, if both file has data, the workflow will fetch the two files in the "with data" folder to attach. Another example is, if the Student name has data and Student score has no data, workflow will fetch one from the "with data" folder and the other one outside the "with data" folder. Will this be possible?

 

Student folder.PNG

Student folder2.PNG

 

Hoping for your response.

 

Thanks,

Kamen

Carlithian
11 - Bolide
11 - Bolide

What you want to achieve is possible, but it will require some work setting up. You need to create a dynamic version of the Email tool, as this will allow you to select the attachments at runtime.  This involves putting the email tool into batch macro, and using the control parameter to overwrite the settings of the email tool.
If I remember correctly when I last built this you will need to update the data in the attachment tags of the Email tools XML

 

Dynamic Email Tool.png

KamenRider
11 - Bolide

Hi @Carlithian 

 

Thanks for tor response however, I am not familiar with this dynamic process. Can you give me sample and explain to me further how I can configure from settings and so forth?

 

Please advise.

Kamen

Yoshiro_Fujimori
15 - Aurora

@KamenRider ,

 

I would do this way.

1. Get all the file names under "Student" folder with Directory tool (with [Include Subdirectories] option to "ON").

2. Filter the row with the file name to check for today.

The expected file name can be prepared with functions in the Filter tool. e.g.

Contains([Filename], DateTimeFormat(DateTimeToday(),"%m.%d.%y student name"))

3. Read the file with Dynamic Input tool for name and score respectively.

4. Plug-in the output anchors to the workflow I attached in earlier post.

 

I hope this helps.

KamenRider
11 - Bolide

HI @Yoshiro_Fujimori 

 

Can you please present it in a workflow type sample so I could get what you mean?

 

Thanks and appreciate you assistance so much on this.

 

Kamen

KamenRider
11 - Bolide

Hi @Yoshiro_Fujimori 

 

Can I request for your sample workflow in order for me to see the whole picture?

 

Looking forward for your continued assistance.

 

Thanks,

Kamen

Yoshiro_Fujimori
15 - Aurora

@KamenRider ,

 

Here is an implementation of what I mentinoed earlier.

1283911_Workflow_2.png

KamenRider
11 - Bolide

Hi @Yoshiro_Fujimori 

 

Thanks for the sample workflow. Tried testing it and it works except when the excel file has no data. Can you please help me once again with this? See below error: I do hope it will work in all conditions like when the other file has data and the other has not.

 

cant find path.PNG

Looking forward for your response and continued assistance. Thanks.

Kamen 

Labels