Support Questions

Find answers, ask questions, and share your expertise

Date plus one day with update attribute

Explorer

Hey everyone,

I want to make an API request for every single day in a period.

MarioFRS_1-1660743746472.png

 

I have defined a start date and an end date in the Generate Flow File Procesor

MarioFRS_2-1660743842652.png

the api structure is as follows

https://example.com/interfaces?session=${SessionId}&date_start=${since}&date_end=${since}

and now I want to loop with route on attribute and update attribute to request all days in this time period.

now the question how can I, the attribute of the start date always increase by one day. with the following expression in the update attribute processore I get an empty field as result

${since:toNumber():plus(86400000):format('yyyy-MM-dd')}

MarioFRS_3-1660744604543.png

Result

MarioFRS_4-1660744717225.png

Does anyone have an idea what adjusted we

 

1 ACCEPTED SOLUTION

Super Collaborator

Hi,

Try the following Expression:

 

${since:toDate('yyyy-MM-dd'):toNumber():plus(86400000):format('yyyy-MM-dd')}

 

If you find this helpful please accept solution. Thanks

 

 

 

View solution in original post

2 REPLIES 2

Super Collaborator

Hi,

Try the following Expression:

 

${since:toDate('yyyy-MM-dd'):toNumber():plus(86400000):format('yyyy-MM-dd')}

 

If you find this helpful please accept solution. Thanks

 

 

 

Explorer

Hi,

Thank you for your support. The conversion to a date form type I had not in mind

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.