OL Learn

Load Json settings in workflow

Im a looking for the best way to maintain key value pair settings list for consumption and lookup within the workflow.

I feel like I can get there with a Datamapper (or template) using “loadjson”. But I don’t want to do it in the datamapper.

Some of the “similar” topics are 5+ years old and have broken links to OL Learn.

I envisioned the json key/value pair collection to some like one of these …

{ “EventType” : “key0001”, “Code” : “FIN.EXL1000.RNWL.INPUT2_PKG101” },
{ “EventType” : “key0002”, “Code” : “FIN.EXL2000.LTTR.INPUT1_PKG109” }
“key0001” : “FIN.EXL1000.RNWL.INPUT2_PKG101”,
“key0002” : “FIN.EXL2000.LTTR.INPUT1_PKG109”,

I have the value “key0001” in my metadata, and I want to find/lookup “FIN.EXL1000.RNWL.INPUT2_PKG101” so that I can use it to build an output file name.

Thanks for your help.

Hi @bradnowak,

Can you let us know please what you would like to achieve? I suppose that you would like to do a lookup in the–by PlanetPress Workflow generated–metadata with available JSON data and that you would like to execute this lookup for each key+value pair, is that correct?

Sorry If I didn’t clearly convey my need. I will try to restate …

My metadata will contain a field (EventType = “key0001”) which I want use to “lookup” a corresponding “Code” which will be used in the workflow to set the name of an output file.

My thought was to have a JSON file (with the EventType <=> Code mappings) on the PlanetPress server, and have the workflow pull those configurations at the time of PDF file creation (for the print vendor).

Hope that helps. I appreciate your quick response/assistance.

Please let me know if any addtional details would be helpful in suggesting a high level approach (and eventually supporting implementation details as needed).

You should store the values in Workflow’s Repository and then use the lookup() method to pull those values on demand. That way, you won’t need to constantly load and parse an external JSON file or to use scripts to do so.

More information on the repository can be found in this online help page.