You could add a column to your list and calculate the DATE() of your date.
Suppose you column name is birthDate and a value is 25/12/2000, and you create a column named birthDate_DATE ( calculated DATE(birthDate)) , the value will be 25.
You could use birthDate_DATE in your workflow.
Hi,
Thank you for your suggestion. I've created a column called 'Day_Only' in my list and that displays the day of the month.
The workflow is running and stuck there as status 'started'. The error I am getting when I click on workflow status is this 'The field 'Day_x0020_Only' of type 'Calculated' cannot be used in the query filter expression '
The Day_Only calculates to 5 on the list-view and there is only 1 item on list.
PS: I created a new column called 'Next Day' as a static value holding column. Assigned it number 5. Then pulled this into workflow and it worked. The workflow seems to have issues with 'calculated' fields (unless I am doing something wrong).
Is there any other ways to calculate the 'day' portion of the current date within the workflow? This would be helpful for me in designing future workflows which has to be triggered if the current date = due date (of a list item)/etc.
Hi Shanan,
Follow the below steps:
1. Create a date type variable and set "Blank" for default date.
2. Create a single line text variable.
3. Create a Number type variable.
4. Insert workflow action, Set Variable , assign date variable with "use date when action is executed"
5. Insert another workflow action, Set Variable, assign text variable with "fn-FormatDate(datevariable, "dd")
6. Insert "Convert Value" workflow action, and convert "text variable" to "number variable"
7. Insert Run If action, check if "number variable is "x number"
8. Then send email.
Thanks!
I am getting an error 'Input string was not in a correct format'. Below are some screenshots from inside the actions
Any help is much appreciated!
Converting text to number below
Hi,
Better keep a log and display the value in DataType and TextType variables before the each wrokflow actions, and see if the variables have correct values.
Thanks. I did that and here is the result before going into 'convert value' box (and after defining values)
TextValue (should this show the formula considering it is logging after the formula?)
fn-FormatDate(7/7/2017 3:12:26 PM,"dd")
DateValue
7/7/2017 3:12:26 PM
So, what is the output value for TextVariable when you assign it with fn-FormatDate(7/7/2017 3:12:26 PM,"dd")?
It supposed to return "7" (in text variable).
Then convert this "7" (text variable) to number.
It should work.
Hi,
The first log-history, I put in '{Variable:TextType}' as description. Second one same thing - I got the following results respectively. In one of the above screen caps I have shown the formula as written.
Could this be caused by the time attached to the date?
No, it can not be an issue, I see the time portion appended to date in my workflow too.
I am using On-Premises Nintex workflows, and yours is Office 365 Nintex. There should not be any problem with date functions as per my knowledge.
Can you give a try by hard coding the date value in FormatDate() function? like, fn-FormatDate("7/7/2017","dd")
and replace double quotes with single quotes if the above not worked.
Same issue
I've attached my workflow for your reference. Thanks for the help up to this point!
Hi,
In Nintex for O365 there are no runtime functions, that's why you still see the fn-FormatDate(...)..
a possible workaround is the following:
- create a date/time variable and set it as current date inside the workflow
- create a text variable set as in the picture:
- do a regular expression on the text variable in order to replace everything before the first / and save results in the same variable
- do a regular expression on the text variable in order to replace everything after the first / and save results in the same variable
Maybe there is a quicker way to do a regExp that select everything outside the first two / in just one action, but this also do the work..
Two regular expression are needed to extract day part of a date in format MM/DD/YYYY, if your date is instead in format DD/MM/YYYY, then first regex is not needed.
Giacomo