I have some flows created, the structure like below.
(1) Email input flow, M365 input… some dirty code…save pdf attachement to different folders
(2) Folder capture from (1) then execute datamapping, output the xml to a folder.
I can gather the email sender /subject from (1),
and I want the output xml file contain the email sender/subject information in the extract data.
is there any method to get it done under workflow ?
Add the email sender/subject to the PDF metadata using a Workflow script.
Then when you pick up those PDF, extract the metadata from it and pass it as a runtime parameters to the Datamapper.
var myPDF = Watch.GetPDFEditObject();
myPDF.open(Watch.GetJobFileName(),false);
var meta = myPDF.GetInfos();
Watch.SetVariable("keywords",meta.keywords);
myPDF.Close();
Of course, if you kept all of this inside a single process, you could do the following:
1- Email input flow, M365 input… some dirty code…
2- Add the email sender/subject to local variables
3- Call the Datamapper and pass it the email sender/subject as runtime parameters
4- Voila!
set MyPDFInfos = CreateObject("AlambicEdit.PdfInfos")
set MyPDF = Watch.GetPDFEditObject
dim myVar
myVar = Watch.GetVariable("varEmail") &";" & Watch.GetVariable("varSubject")
MyPDF.Open Watch.GetJobFilename, False
MyPDFInfos.Keywords = myVar
MyPDF.SetInfos MyPDFInfos
MyPDF.Save False
MyPDF.Close
the folder pdf capture flow
var myPDF = Watch.GetPDFEditObject();
myPDF.open(Watch.GetJobFileName(),false);
var meta = myPDF.GetInfos();
//Watch.SetVariable("keywords",meta.keywords);
var str = meta.keywords;
var str_array = str.split(';');
Watch.SetVariable("varEmail", str_array[0]);
Watch.SetVariable("varSubject", str_array[1]);
myPDF.Close();
Can’t really tell you if the config is good as I have no idea what you want from it but you dont really need to put the content of a runtime parameter into a field in the Datamapper.
You can simply call it when needed by calling it through a script.
You then need to ask yourself, do you need it in your Datamapper or in your Template? If the latter, then pass it to the runtime parameter of the Template, not the Datamapper.
the way you have done it now is that the paramter will be available only if the Condition2 is met.