Skip to main content
MarioFRS
Gold ⭐️
August 17, 2022
Solved

Date plus one day with update attribute

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

 

SAMSAL
SAMSALAnswer
Platinum ⭐️⭐️⭐️
August 17, 2022

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

 

 

 

2 replies

SAMSAL
SAMSALAnswer
Platinum ⭐️⭐️⭐️
August 17, 2022

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

 

 

 

Translate
MarioFRS
MarioFRSAuthor
Gold ⭐️
August 18, 2022

Hi,

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

Translate