Workflow with Date calculation


Badge +1

Google Übersetzer

Hi Guys,

I need your help. In Sharepoint and workflow is quite a newbie and would like to take your support.

We have in the Sharepoint a calendar, which we use for our holiday recordings. I have created a workflow with Nintex for this calendar. This also works in the basic settings.

Now to my request:

The workflow should only be started if the holiday time is longer than 5 days, if smaller than or equal to then just send an email to the GroupOwner and the Approver.

How can I start a calculation in the workflow to determine the days from the start date and end date?

Also the determination of the group does not work, he always pulls the AD group.

I've created several groups with one owner. But somehow, the workflow seems to ignore them.

10 replies

Userlevel 5
Badge +14

you have several options

- you can use Math action.

note however, that this returns difference in seconds, so you might need to converts it to days

207346_pastedImage_1.png

- or you can use set variable action and use inline function DateDiffDays to do calculation.

problem here is that set variable action allows to define formula only if target variable is of string type. so for further comparisons you might need to convert numeric variable

207353_pastedImage_2.png

- or you can use ConvertValue action.

this should be straightforward and return day difference into numaric variable

207354_pastedImage_3.png

‌ date difference‌

Badge +1

many thanks for your answer

Userlevel 5
Badge +14

‌, if that helped you to resolve your issue, please mark the answer correct

Badge +1

Hi,

i tested with function "convert value", i get error messages

207636_pastedImage_3.png

with this variable

207637_pastedImage_4.png

but after running i have this error message

207638_pastedImage_5.png

i have try with integer and number, same result.

Do i have to convert the date before?

maybe someone can help

Userlevel 5
Badge +14

try to enclose date variables with {TextStart}/{TextEnd} as in my example

Badge +1

Hi,

Google Übersetzer

I've tried it with your preferences. unfortunately the same mistake. Do I need to format the date?
Userlevel 5
Badge +14

can you check what's your configuration for "Always follow web settings" in User >> My Settings >> My Language And Region  >> Region

Badge +1
is the setting for language and region relevant to the functionality of the workflow? it is set to German.
i tested with seetings for english and i have same Error. 
Workflow Details
Error parsing value. Value 'fn-DateDiffDays (9/26/2017 11:59 PM,9/20/2017 12:00 AM)' is not compatible with the selected output variable type Number (double).

I have no idea what i can change,
Badge +6

You can format the dates using ISO template: yyyy-MM-dd hh:mm:ss

Userlevel 5
Badge +14

it's not about one or the other locale.

it's specifically about the "Always follow web settings" option.

I mean this setting

207865_pastedImage_2.png

if you do not have it checked on, no inline function  that expects date type input parameter works in workflow.

regardless of locale you have configured for site or user, or what culture you set in workflow action (where available)

you can see it confirmed as "feature" by nintex here - fn-FormatDate doesn't work with specific regional settings 

Reply