Hey guys.
I’m having a little problem with calculated fields and SharePoint 2013 Workflow.
I’ve a variable named ‘vLondonContractHours‘ and have set it like so;
Set time as 9:0 for Current Item: Created (Output to Variable: vLondonContractHours)
Then I was able to…
Set Daily Contract Hours to Variable: vLondonContractHours
…this gives 09:00 hours which is correct. Now, I want to multiply this by 5 and Update an Item (where the item column is called ‘Weekly Contract Hours’). However using the following action doesn’t work;
Add 0 months, 5 days, 0 hours, 0 minutes to Variable: vLondonContractHours (Output to Variable: vLondonWeeklyContractHours)
The problem is that this doesn’t work. I’ve also created a number column and set a default value of 5 (for 5 days). Then I created a Calculated Column named ‘Weekly Contract Hours’ with the formula;
=[Daily Contract Hours]*5,”h:mm”)
The produces an error in the workflow where the calculation is made.
In short I want to multiply one date and time column which is set from an internal variable by another number column which is set to number 5.
Your help will be appreciated.
Thanks, Larry
because number fields will produce integers. i don’t want it to produce 100.5555 minutes or -100.5555. end users will have to calculate this in hours for themselves… not good user experience.
I still don’t see a reason as to why you are using a datetime field instead of a number field to get that calculation.
this is what i am trying to do…
im trying to compare daily ‘contract hours’ set to 9 hours virus hours actually worked which is ‘activity hours’. then i also want to compare ‘weekly contract hours’ (9h * 5) which is 45 hours with weekly worked hours or ‘running balance’ (i use a concatenate state for running balance)…
i’ll have the workflow send an email if ‘activity hours’ is less than ‘contract hours’
and
i’ll have the workflow send an email if ‘running balance’ is less than ‘weekly contract hours’
I don’t think using a datetime column will work for this scenario. The 9:00 you are receiving in the first calculation equals 9:00 a.m. and not a total hours of 9. If you add 5 days to 9:00 a.m. it will just take you to 5 days later at 9:00. If you want to calculate 45 hours per week you will need to use a number column to get that type of calculation.