I’m wondering if it is possible to create a “report” through workflow, that checks the fields in a .csv and flags if any of the data in certain fields goes over 50 characters?
I’ve got a field set up in my datamapper called “CharacterLimit” that uses a script to check if any fields go over the limit, but I’m just needing to get that field, if it contains anything, to output to a .csv or .txt through workflow, along with say the record number to be able to cross reference.
You say you already have in your Datamapper a script that check for overflown fields. Then, in your Workflow, in the Execute Datamapping plugin, set the Output Type to Simplified JSON.
Look at the JSON via a text editor to see what you have and then using Workflow’s Run Script plugin with language set to Enhanced JScript, extract the value from the JSON, store it in a variable and voilà. Next is it only a matter to build whatever report you want.
I just need a little more help with the second part. I’ve got the JSON, but are you able to give me an example of what the script should be, how to store it as a variable and then how to build the report?
Sorry, I am very new to OL Connect so any help is greatly appreciated
Here is another method that can run with or without Workflow. In the attached CSV Data Mapping config I have a Postprocessor script that writes to a CSV file any records that exceed the 50 character limit. Adjust the Postprocessor script to your desired output.
The Postprocessor script can be viewed by selecting the “Prostprocessor step” (the chequered flag), in the Actions pane you will see a Postprocessor script called ExportToCSV. Make sure the output folder exists at C:\\out
My Extraction contains a field called recordNum that is set to JavaScript using record.index which gives the script the record number of the CSV input data.
Everytime the mapper is run, be it in the designer or Workflow, it will export to a CSV. e.g. Log 19-11-2025.csv
Thanks so much @Sharne, it sounds like that will be perfect, but I couldn’t open the sample datamapper file, it came up with an error saying “invalid config file”
Are you running the mapper sample as is and get the error, or did you modify anything? If you are trying to add the script to your own CSV data mapper, then yes the script will need changes to match your CSV fields.
What version of OL Connect are you using by the way?