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

why can I not connect a variable to a single line text box?

Jump to solution

hi all, 

 

I am just trying to do something relatively simple but i've obviously done it wrong (again) so seeking your assistance to identify the issue.

 

I have a form with two datetime type controls called StartDate (which is 'connected to' the list column StartDate) & EndDate (which is 'connected to' the list column EndDate).

 

I have created a couple of calculated value cells, one of which requires a 3rd input, the other which just gets the days difference between the start and end date.

 

This calculated value uses the dateAddMonths inline function with the parameters StartDate (from Item Properties) and intMonthsToAdd (an integer type Form Variable I have created).

Q1. Am I using the right control?

Q2. Can I use a Calculated Value to display a calculated date as per the below format?

 

calcvalueAddMonths.PNG

 

This (below) is the calculated value for the days difference between the start and end date.

 

The Form Variable 'intDaysDifference' shown in the formula bar below uses the following formula to calculate its value:

 

dateDiffDays(StartDate,EndDate) 

 

I've also noticed once I have saved the formula it changes appearance to this:

 

dateDiffDays({ItemProperty:u2sv},{ItemProperty:tjfd})

 

I am not sure why this does not calculate when I pick the Start Date and End Date.

 

Q3. do I need to structure this a different way to get the calculatd value to calculate straight away?

 

calcvalueDaysDiff.PNG

 

This (below) is the single line text box I've created to input the integer type Form Variable required for "intMonthsToAdd", the calculated date value mentioned in Q1 and Q2. 

 

I know I need to get the value into the Form Variable "intMonthsToAdd" but I cannot see how it connects to the Form Variable.

 

Q4. Can someone help me to understand how this works or what I am doing wrong? 

 

SLTTermInMonths.PNG

 

 

Labels: (2)
0 Kudos
Reply
1 Reply
Highlighted
Automation Master
Automation Master

Re: why can I not connect a variable to a single line text box?

Jump to solution

 

 

Q1. Am I using the right control?

I guess this question relates to topic subject

why can I not connect a variable to a single line text box?

 

you need not to connect calculated value control to a variable. once you assign a name to calculated value control it appears among 'Named Controls' and you can use it in other calculations/formulas just like form variables.

 

in general, it's not allowed by design..

it doesn't make too much sense to connect form controls to form variables. at first, all the (needed) controls can be referenced as 'Named controls' and at second form variables are valid just within form session, so there is not any benefit to 'storing' anything to a form variable

 

 

Q2. Can I use a Calculated Value to display a calculated date as per the below format?

yes, this should work.

 

 

 

I've also noticed once I have saved the formula it changes appearance to this:

dateDiffDays({ItemProperty:u2sv},{ItemProperty:tjfd})

I am not sure why this does not calculate when I pick the Start Date and End Date.

if you want to calculate something out of form control values you have to reference 'Named controls' in formula(s), instead of 'Item Properties'

'Item Properties' holds list item values already saved in sharepoint. they take a list item value valid at the timepoint form loads and the value doesn't change throughout the form session. 

 

 

Q3. do I need to structure this a different way to get the calculatd value to calculate straight away?

no, that should be correct

 

 

 

I know I need to get the value into the Form Variable "intMonthsToAdd" but I cannot see how it connects to the Form Variable.

 

Q4. Can someone help me to understand how this works or what I am doing wrong? 

no, you need not to connect/store text control value into a variable. you can reference it in other formulas directly as 'Named control'

View solution in original post

0 Kudos
Reply