Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Nintex Community
- :
- Forums
- :
- Nintex for SharePoint
- :
- Calculated column formula to calculated value

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I know that calculated columns don't work on Nintex forms. So my question is, how would I get the following calculated column formula converted into a calculated value on a form?

Calculated column formula:

=TODAY()+(7-WEEKDAY(TODAY(),2))

Solved! Go to Solution.

10 Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Not the Solution
- Email to a Friend
- Report Inappropriate Content

This should replicate what you're trying to achieve.

`formatDate(dateAddDays({Common:CurrentDate}, (7-(new Date ().getDay()))), "d")`

Breaking it down into parts:

`//{Common:CurrentDate} === 3/7/2018`

//new Date ().getDay() === 3 (aka: Wednesday)

formatDate(dateAddDays({Common:CurrentDate}, (7-(new Date ().getDay()))), "d");

// translated...

// formatDate(dateAddDays(3/7/2018 12:00AM, (7 - (3))), "d");

// translated...

// formatDate(dateAddDays(3/7/2018 12:00AM, 4), "d");

// translated...

// formatDate(3/11/2018 12:00AM, "d");

// translated...

// 3/11/2018

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

For my understanding, what is "new Date" and ".getDay?" Where are these coming from?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

That's just basic javascript (JavaScript getDay() Method or Date.prototype.getDay() - JavaScript | MDN).

Calculated Value control Formulas are just evaluating javascript at the end of the day, so you can use it inside of there with no problems (most of the time).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

I figured. However, not getting a result when I preview it, hence I asked. This is what I have:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

Make sure that the view options in the properties of your calculated control are set to ReCalculate value on View:

Otherwise you won't be able to preview it.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

Hmmmm. Mine seems to still be blank...

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

Please copy and paste the code in my first reply into your formula field. You have a typo after the getDay where you have left off the invoking parentheses.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

My man! Perfect! Preciate it!!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Re: Calculated column formula to calculated value

nmarples Do you know if there is a way to restrict a datepicker to not allow for future dates. I was trying to come up with an expression within the Date/Time control to do this, but I think its going to have to be done with javascript.

With that said, I think I'm close. I know I can do the following or something similar:

`$('#datepicker').datepicker({ maxDate: 0 })`

which would essentially not allow for any date past 'today.'

I'm having trouble converting this to being used on the form. I think I would need to store it in the javascript variable and reference it, but I'm not sure.