Hi All. I'm trying to import data from a CSV, then later in my workflow do a calculation on two dates. When the data comes in through the CSV, however, the dates are strings. So I built a custom macro that takes the string date and converts it to a DateTime value.
My problem is that when I connect it to my data source, it only outputs the DateTime value and leaves all of the other data from the source (ie. names, order numbers, etc) behind. How can I create a workflow that will run the dates through my macro to convert them, but then rejoin the converted date with the rest of the record that comes in with the source.
I included an example of what I would like to do along with the date conversion macro. The input isn't a CSV but it should work the same.
Thank you.
Solved! Go to Solution.
A Standard Macro will by default only pass whatever columns are in the Macro Input template.
To get the rest of the fields to come through, put a Select tool after your Formula too, and add the Action to "Update Select with Reverse Field Map" (linking the Macro Input to the Action to the Select).
I've attached a simple example.
You may be able to achieve your ultimate goal (parsing a custom date/time) with the DateTimeParse function in the Formula tool. I think that would replace your entire macro.