Skip to main content
Nintex Community Menu Bar
Solved

Set Value Of Single Line Text Field by Concatenating two Calculated Values

  • June 22, 2022
  • 7 replies
  • 1190 views

kgiles
Forum|alt.badge.img+4

I'm using Nintex Classic Forms2013

Very new and very lost...
I have two Calculated Values: Date_ & Time_

These values update on form load

I want these two values to concatenate into a single line text field, TimeDate

Please and thank you!

Best answer by Garrett

Hi @kgiles 

 

Form Controls

1. Calculated Value Name = Time_Date
2. Single Line Text Field Name = Destination

3. Assign the Client ID JavaScript variable name to both control. (Settings - Advance)

 txtTime_Date

  txtDestination

 

4. Place the following code into the Form Settings - Custom JavaScript

NWF.FormFiller.Events.RegisterAfterReady(function() { var x = NWF$("#" + txtTime_Date).val(); var y = NWF$("#" + txtDestination); y.val(x); });

This will assign the value of Time_Date to Destination eg pass Time_Date value to Destination. 

as you stated - "Time_Date to set it's value to Destination."

 

Form Design

Form Output

 

hope that helps

7 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • June 22, 2022

Hey @kgiles ,

 

Why not use a Calculated Value control instead of a single Line Text control?

 

On your Classic Form, Add a Calculated Value control.

Configure the Calculated Value control using the Formula Builder:

(Insert the variable by double-clicking them in the Named controls)

Formula: _Date + _Time

If you need to add a space in between 

Formula: _Date +" " + _Time

Preview the form to check the result. 

 

 

 


kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • June 23, 2022

Thanks for your help!

Setting the value of a single line text field based off of a calculated value is what I'm trying to focus on. I have many uses for this but no easy built in options to perform this action. 


Garrett
Forum|alt.badge.img+16
  • Scout
  • June 23, 2022

Hi @kgiles,

Could you elaborate with an example what you wish to achieve?

Did my suggestion help to resolve your initial issue?


kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • June 23, 2022
I changed up some values:
1. Calculated Value Name = Time_Date
2. Single Line Text Field Name = Destination
3. On form load, I would like Time_Date to set it's value to Destination.
Hope I'm making sense and thank you

Garrett
Forum|alt.badge.img+16
  • Scout
  • Answer
  • June 23, 2022

Hi @kgiles 

 

Form Controls

1. Calculated Value Name = Time_Date
2. Single Line Text Field Name = Destination

3. Assign the Client ID JavaScript variable name to both control. (Settings - Advance)

 txtTime_Date

  txtDestination

 

4. Place the following code into the Form Settings - Custom JavaScript

NWF.FormFiller.Events.RegisterAfterReady(function() { var x = NWF$("#" + txtTime_Date).val(); var y = NWF$("#" + txtDestination); y.val(x); });

This will assign the value of Time_Date to Destination eg pass Time_Date value to Destination. 

as you stated - "Time_Date to set it's value to Destination."

 

Form Design

Form Output

 

hope that helps


kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • June 23, 2022

Thank you so much! This opens a lot of doors. 


Garrett
Forum|alt.badge.img+16
  • Scout
  • June 23, 2022

You're welcome. Glad it manage to open doors for you.