To add elements in an array object
My requirement is based on the input parameter(no of days) of a pipeline, I have to execute the the child pipeline which calls a API URL like below.
If the input paramater is 4, the child pipleline should execute as below.
https://xxxx/xxxx/testing?startdate=10-17-2018&enddate=10-17-2018
https://xxxx/xxxx/testing?startdate=10-17-2018&enddate=10-16-2018
https://xxxx/xxxx/testing?startdate=10-17-2018&enddate=10-15-2018
https://xxxx/xxxx/testing?startdate=10-17-2018&enddate=10-14-2018.
To accomplish this, i am trying to build an array with dates dynamically based on the input paramater. If the input paramater is 4 the my array variable should be like [“10-17-2018”, “10-16-2018”, “10-15-2018”, “10-14-2018”] and then pass these dates as documents to the child pipeline calling the API.
Is this the correct approach and if so how do i build the array dynamically (ie some sort of looping is required i believe which i am not able to achieve in SnapLoigc). I would really appreciate if a solution is provided.
Thanks