cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Looking for some examples to advance date parameter by x days

vcocco
New Contributor II

Hi all,
I currently run an integration manually by keying in a date as a query parameter, then running it again, manually every two weeks (every 14 days).
Iโ€™m looking for some example code that would enable me to automate this process.
I think I would probably have to run the pipeline manually the first time on the given date, then change the code to use something like โ€˜current_date + 14โ€™.
Does this make sense?
Hereโ€™s how date parameters is currently setup:

SnapLogicRestDate

3 REPLIES 3

dmiller
Admin Admin
Admin

Any reason you couldnโ€™t do this with a scheduled task set to run every 2 weeks if your dates were Date.now?


Diane Miller
Community Manager

stephenknilans
Contributor

Forgive me if this is too messy, BUTโ€ฆ

Date.parse($Today).plusMonths(1).toLocaleDateTimeString(โ€˜{โ€œformatโ€:โ€œyyyy-MM-ddโ€}โ€™)

Anyway, this determines the value for the date, adds one month, and then formats it. There are a number of similar ways to do this.

Thank you for the follow up.
I think Iโ€™m going to go with the first solution involving โ€˜Date.nowโ€™ and just schedule a run every two weeks.

Thank you all for your suggestions.

  • Vin