Insert metadata from email into a job

Post Reply
dhutton
Newbie
Posts: 7
Joined: Mon Sep 23, 2019 4:53 pm

Insert metadata from email into a job

Post by dhutton »

I am new to Switch so I am sure some of my terminology is not correct. I am wanting to figure out how to merge information from two different sources so that I can use metadata from both sources to direct the flow.

We have a file submission portal that puts submitted files in a folder on an FTS server with the following format.

222222 (this is the folder name)
-file1.pdf
-file2.pdf
-file3.pdf etc

We also get an email with the following text in the body of the email.
Job Number|222222
Internal Job Number|55555
Submission Type|New Job
Email|test@test.com
Upload ID|5983
Upload Date|Tue, 01/23/2024 - 16:22

I really need to be able to get the Internal Job number and the Email from the email we receive to then be able to set up the output folder structure, as well as be able to send notification emails to the correct person. I am able to receive the emails using Mail Receive and convert the body to a .txt file, and I am downloading the files to our server just fine. What I am not sure how to do is combine the two and how to get the data out of the email in a meaningful way. We do have the metadata module.

Any guidance on how to merge these two data points together so switch knows they are the same job would be helpful.
dhutton
Newbie
Posts: 7
Joined: Mon Sep 23, 2019 4:53 pm

Re: Insert metadata from email into a job

Post by dhutton »

I have found a different solution to this that is working for now. Instead of getting the data from an email I am Using the HTTP Request to reach out to the site where the files are being downloaded from and getting an XML file.
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

Re: Insert metadata from email into a job

Post by freddyp »

The different solution you have found is certainly better, but just for the sake of knowing about it: there is an app "TXT pickup" that allows you to convert a text file (or in this case the body of the mail) to XML. With the nice structure of the example you have shown this would work very well: https://www.enfocus.com/en/appstore/product/txt-pickup
Post Reply