OL Learn

Passing Planet Press Designer datamapper variable to Workflow

Hi all,

I have some logic to extract some groups of lines of content in a text file. This is a repeat step until the line is not empty. So the first line we reach within the file (starting from the top) will be our line to begin our extraction. Then with the groups of texts extracted, I use the first line of the groups of texts to name the file name output, e.g. SOMESOMETEXT_REFERENCENO.txt. I have some JavaScript within the data mapper to give me the line and concatenate it with some other variable as above in a field as “FileName”.

I am looking for a way to pass this “FileName” field data mapper variable to the Workflow. I have looked around the forums, but seem to get anything that I can start with. I would like to avoid having to utilise the Workflow to achieve this if possible, but if I must then that would be a start.

Thank you in advance.

You can do that by making use of the “Set Job and Variables” task (1). After selecting the variable (“Var/Info#”) you want to change, you can add the value of the record field “FileName” by right clicking on the “Value” property. After that choose the option: “Get Metadata Location” (2) to select the record field. Make sure that the “Execute Data Mapping” task (3) will be executed before the “Set Job and Variables” task.


References

PlanetPress Workflow 2020.1 User Guide

  1. Set Job Infos and Variables
  2. Data Selections
  3. Execute Data Mapping

@Marten,
I think that what he wants is the other way around. He wants to pass a variable back to the Workflow process.
If I am correct, then it is quite easy. You already have a field in your Datamapper. So in your Workflow, open the Execute Datamapping plugin and set the Output Type to Metadata or XML or JSON, which ever you feel familiar too.
Then simply extract the value from the field. In metadata, the field would be name something like this:
_ vger_fld_<name of your field>

Hi @hamelj,

I want to pass a variable to the Workflow from the Datamapper which is set up to extract from a text file.

What is the process of creating a metadata file that I can use for this case?

In the Designer, I have a “Job Creation” which I think is a way to create the metadata

The “Create Metadata” plugin requires an existing metadata file. Not sure if I have missed a step.
image

I could be over complicating things. Would really need some guidance.

Thanks for your help in advance.

There are two different “metadata” systems in PlanetPress Connect & Workflow, and they don’t mesh very well.

If the final need is to create separate output documents and use a value from the data as part of the output filenames, then you need to use Job Preset to create the “Connect metadata” field, and an Output Preset to perform the Separation and use the metadata field as part of the name in the separation settings. This is all part of Connect and you don’t need to use any of the Workflow metadata plugins.

If you need the value in Workflow for other reasons, then you can check the “Metadata” (rather than “ID only” option) in the Execute Data Mapping task. That will expose all fields as “Workflow metadata”, and you can read that value into an Automation Variable using the “Set Job Infos…” task (Get Metadata Location).

Hi all,

You guys are genius.

Just needed to digest all of your comments. I have gone through this route to setup in the Workflow

I was able to get the metadata file if I debugged the Workflow then Get Metadata at location and navigate to the field I wanted.

Will leave this comment here for who ever wants a similar solution.

Thanks for your help :smiley:

1 Like

I don’t think you need the Metadata Fields Management task.