I have a job coming into Switch. In the job folder is a PDF with the name of a person I need to email for approval. I am trying to grab that name then strip it out of the name yet use it later to send the email to for approval. Sample PDF is named 123456L Compnay JohnDoe.pdf I want to store JohnDoe in side of the metadata then rename the file to 123456L Company.pdf and send JohnDoe@ourcompany.com an approval email with a link to where we are hosting the pdf.
I can do everything but get JohnDoe email working.
Setting and using data in Switch for email address
- magnussandstrom
- Advanced member
- Posts: 365
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Setting and using data in Switch for email address
You can set ’name’ to a PrivateData tag and use it later in the flow.
In Folder properties > Set job private data:
name= [Job.Name:After=" ",Before="."]
Later in the flow you can use the variable:
[Job.PrivateData:Key="name"]@company.com
This way you can use the name in an email adress even after you have removed it from the file name.
In Folder properties > Set job private data:
name= [Job.Name:After=" ",Before="."]
Later in the flow you can use the variable:
[Job.PrivateData:Key="name"]@company.com
This way you can use the name in an email adress even after you have removed it from the file name.
Last edited by magnussandstrom on Mon Aug 14, 2023 9:11 am, edited 3 times in total.
- JimmyHartington
- Advanced member
- Posts: 310
- Joined: Tue Mar 22, 2011 7:38 am
Re: Setting and using data in Switch for email address
In the mail send you could set the to address to the variable below:
[Job.NameProper:After=" "]@company.com
In my test with a sample file named "123456L Compnay JohnDoe.pdf" it gives me "JohnDoe".
[Job.NameProper:After=" "]@company.com
In my test with a sample file named "123456L Compnay JohnDoe.pdf" it gives me "JohnDoe".