Forum Discussion
You’re looking for the extend() method on objects. It will take an array of key/value pairs and return a new object consisting of the original object plus the properties from the array. But, first, we need to change the TabStatus array into pairs using the map() method, like so:
$TabStatus.map(x => [x.TabLabel, x.TabValue])
Putting it all together, you can use an object literal to create an object with the values you want to pass through and then call extend with the massaged TabStatus array:
{
EnvelopeID: $EnvelopeID,
RecipientId: $RecipientId
}.extend($.TabStatus.map(x => [x.TabLabel, x.TabValue]))[/code]
There are other ways to do this as well, you could call extend on the original document (e.g. $.extend(...)
). But, that would include the original TabStatus array in the output, so you’d have to use a separate mapper to delete that.
(Thanks for providing example output, makes things much easier.)
Can you provide the input and expected output ?
Hi Anil,
The input is from a filter snap with the above mentioned filter expression. This returns 2 files, for example one with 07/02/2019 date and another with 07/23/2019. The expected result from this filter snap here should be the file with the time stamp 07/23/2019 as that is the file with latest timestamp.
Essentially, i am reading a directory folder where excel data files are added every month, and i am wanting to build a pipeline to read the latest file and drop the data after some manipulations onto the database.
Regards,
SantoshHi @Sgarim4
Please find the attached pipeline. which might help you.
pickLastDateValue_2019_07_24.slp (7.1 KB)
Regards,
Anil