Forum Discussion

amit_saroha's avatar
amit_saroha
New Contributor III
3 years ago
Solved

Date Issue in Pipeline Parameter

Hi All, I have a requirement to pass date in YYYY-MM-DD format and I am using the expression “Date.now().toLocaleDateString()” but I have the below issue. When I use it in pipeline parameter...
  • tlikarish's avatar
    7 years ago

    Oh, sorry for the misunderstanding. You want to generate the AddressNO based on the number of elements for each ID?

    You’ll have to modify the sort and group by to do so by ID. Then afterwards you’ll need a Mapper snap using the map expression.

    $group.map((e, index) => e.extend({'AddressNO': index + 1}))

    For each element that was group, this will extend it with the index in the group array.

    Finally now that the elements have an AddressNO you can split everything back out using the JSONSplitter snap.

    I’ve updated the pipeline so you can try it out yourself.

    groupby-example_2018_10_26.slp (8.0 KB)