cancel
Showing results for 
Search instead for 
Did you mean: 
chrisbeck513
Nintex Newbie

How to set the default value to today's month (January, February...) in a nintex mobile form.

Currently I have a fairly simple list consisting of 4 columns, the 2 important ones here are "Month" and "Year".  These are both "Single line of text" in SharePoint as this data is validated then passed to a SQL stored procedure.  I have changed the item on the form to be a Choice and selected it to be a dropdown to avoid user errors later (and to make it easier for the end users on mobile devices).

When I'm on the desktop version of the form the following works perfectly "fn-FormatDate(Current Date, "MMMM").  This then selects the option of May as the default selected option.  This also works the same for the Year except with "yyyy" and 2016 is selected as default from the options in the dropdown list.

When on the Nintex iPad App I get "Control has one or more invalid inline functions".  Upon testing, if I changed 'Current Date' to 25/05/2016 then it works perfectly, May is set to the default.  If I create a separate item for testing and set the default value to 'Current Date' it is returning 2016/05/25.  This is where the problem seems to be occurring as 'Current Date' is providing the function with the date backwards (yyyy/mm/dd instead of dd/mm/yyyy).  I created the same item on the desktop form and it is returning dd/mm/yyyy which I assume is why it is working there.

I've checked all regional settings are UK standard, the iPad is setup to be English UK and not anywhere does US appear in any of the regional settings.  How can I get the date in the formula to be dd/mm/yyyy so I can then get it to display this month and year?

This only works on the desktop form:

This works on both the desktop form and the iPad app:

Using Nintex 2010.  My first question on a forum, hopefully its got everything needed to help me out and its posted in the right place!

Labels: (2)
0 Kudos
Reply
7 Replies
patrickabel
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

Hey Chris Beck​ – Given that your second screenshot works on both the iPad and desktop versions of your form, I would recommend utilizing the fn-FormatDate() function twice.

In your current Default value property, you have an assumption of a specific format coming across from the Current Date value. If you instead execute the fn-FormatDate() function on Current Date and then use the same function to get your defaulted month you should be good to go.

If you need a hand on the syntax, Andrew Glasser​ created a great resource for that: Date and Time Format Strings - Quick Reference Guide

Good luck!

Patrick

Reply
chrisbeck513
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

Thank you for your response.  Unfortunately putting in fn-FormatDate(Current Date,"MMMM") fails on the iPad which is why I'm having this problem. 

For testing what I did was to create a single line text box and set the default value to 'Current Date'.  When I display this on the iPad the default value shows YYYY\MM\DD but if I view the exact same item on the desktop the date is displayed as DD\MM\YYYY.  My assumption is that the fn-FormatDate is failing on the iPad as the date format from 'Current Date' is incorrect.

Reply
chrisbeck513
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

Just wondering if anyone else has any ideas on how I can achieve this?

0 Kudos
Reply
andrewg
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

I've found that I can use the function just fine as long as the date to format is not a reference, like current date. This may be a bug and I would let Nintex Support​ know. I tested this on Nintex Mobile Forms for the iPhone.

fn-formatDate({Common:CurrentDate}, "MMMM") - fails with error on form

fn-formatDate("{Common:CurrentDate}", "MMMM") - fails with error on form

fn-FormatDate("6/18/2015","MMMM") - works find on NMF

Reply
greenawayr
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

I've just found this same issue on Android. Seems it was either never reported or never fixed.

I've contacted support to find inform them.

Anyone got this working or is it a confirmed bug?

0 Kudos
Reply
chrisbeck513
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

I've just tried this again and it appears to be working fine on iOS, I gave up previously and just let the users change it manually.  I've recently updated to the latest build on the server (Workflow 2.5.3.0 and Forms 1.12.1.0) and I'm running version version 4.4.2 on the iPad.  I'm afraid I have no android devices to test this with but maybe it will help you.

0 Kudos
Reply
greenawayr
Nintex Newbie

Re: How to set the default value to today's month (January, February...) in a nintex mobile form.

O365 for me, so maybe that's a difference as well.

0 Kudos
Reply