kgiles
Scholar

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

Jump to solution

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!

0 Kudos
Reply
7 Replies
Garrett
Communicator

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

Jump to solution

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.

Garrett_0-1655932274653.png

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

Garrett_2-1655933108802.png

Preview the form to check the result. 

 

 

 

Reply
kgiles
Scholar

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

Jump to solution

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. 

0 Kudos
Reply
Garrett
Communicator

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

Jump to solution

Hi @kgiles,

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

Did my suggestion help to resolve your initial issue?

0 Kudos
Reply
kgiles
Scholar

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

Jump to solution
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
0 Kudos
Reply
Garrett
Communicator

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

Jump to solution

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)

Garrett_2-1655998835125.png txtTime_Date

 Garrett_0-1655998665837.png txtDestination

 

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

Garrett_3-1655999065683.png

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

Garrett_4-1655999447806.png

Form Output

Garrett_5-1655999544197.png

 

hope that helps

Reply
kgiles
Scholar

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

Jump to solution

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

0 Kudos
Reply
Garrett
Communicator

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

Jump to solution

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

Reply