Calculate the date difference using flow design

Priya Rao
Tera Contributor

Hi All,

 

Based on some trigger conditions, we need to submit a catalog item request. This is done using he subflow and business rules and it's working as expected. 

So now, on the form that we're using for trigger conditions, there's a field 'start_date' and 'end_date'. Based on that dates, when the catalog item request is auto-submitted, we need to calculate the difference in the days (end_date - start_date) not directly from he value in the table. Instead, we need to store the values in the variables in the RITM, then calculate the difference and then store that difference value in the field in the form. How can I achieve this using the same flow design and then update the record. 

 

@Ankur Bawiskar @Rahul Talreja @Pavankumar_1 @Manmohan K @Vishal Birajdar @Dr Atul G- LNG @AnveshKumar M @SwarnadeepNandy 

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Priya Rao 

so based on form fields you need to set variables

you can calculate the difference and set the variable as well with the difference.

Did you try to use inline script while setting the variable?

share current flow screenshots.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

Thank you for your response.

PriyaRao_1-1695621194965.png

From action 5, it's the TASKS. No, I did not use the inline scripts. I tried with other method outside of flow-design. But that did not work.

@Priya Rao 

So what are you doing in action 5?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Creating different TASKS for other automation.