cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

When using the "Calculated Value" option in a SharePoint list on a Date Field, it shows as blank in a Nintex form, but shows correctly in the default SharePoint form.

Example 

Column "date2":

Column Settings

SP form: 

Sp form

Same list, Nintex Form: 
Nintex form

Please advise!

Labels: (1)
Tags (1)
Reply
12 Replies
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

I guess Nintex is not using the fields default values. Bit you can set a rule on form load to set value of your field using inline function

Regards,

Tomasz

Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

Can you step me how to do that? It's my understanding that inline functions are not a thing in the Office 365 version. 

0 Kudos
Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

The other way to do it would be via a bit of JavaScript:

var date = new Date();  

date.setDate(date.getDate() + 7);  

var control = NWF$("#"+ mydatecalccontrol);   if(control.val() == ""){     control.val(date.getDate() + "/" + date.getMonth() + "/" + date.getFullYear()); }

0 Kudos
Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

You would just drop that javascript in the form settings pane:

Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

Aaron idea is good as well

BTW: inline functions are present in Nintex Forms for O365. Indeed they're not available for Workflows (hopefully) yet

Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

First off, thank you for taking the time to help me with this.

See how, in your screenshot, the date showing is "15/2/2017"

That is not a date format that the form can accept. (and even if it were European format, it wouldn't be 7 days from the "today" date.).

Thoughts?

(Note: I understand how to re-order the numbers, but I still can't figure out why it's jumping back to February (2))

-------------------------

FIGURED IT OUT.

Turns out "January is 0" so you have to add one to the month to get the correct month.

Here is the final code (probably a shorter way to write this, but I'm a newb at JS):

var date = new Date();
date.setMonth(date.getMonth()+1);

date.setDate(date.getDate() + 7);

var control = NWF$("#"+ mydatecalccontrol); if(control.val() == ""){ control.val(date.getMonth() + "/" + date.getDate() + "/" + date.getFullYear()); }

Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution
date.getMonth() + "/" + date.getDate() + "/" + date.getFullYear()

Will give you the correct formatting for the US

Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

Whoops! Sorry I spaced on that. I always forget how funky date is in JS... So that works for you now? 

0 Kudos
Reply
Workflow Hero

Re: Date field default value calculated shows blank in Nintex Form (works non-nintex)

Jump to solution

Yes, working. Thank you!

Reply