cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Can't populate text control with calculated value

Jump to solution

I have seen similar questions like this asked but it seems none of the solutions I've seen and tried work. 

I have a People Picker control that sets calculated values for User ID, Email, and Phone. 

All I want to do is have text box controls contain the values from the calculated fields.  So like when you select a user in the people picker, a text box would have the value for Email or Phone.

I have tried using javascript but the change() method does not seem to work for the calculated value or the people picker control.   I know the java script works because if I arbitrarily fire a change() method on a different control like a dropdown then it will write the Email from the calculated value into my text box but that's not the functionality I need.  I need the value to be written to the text box once the person is selected in the people picker and I have not seen a  solution yet that works.

Labels: (1)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

you can do it eg. following way

- update formula in calc value control to something like:   <Exististing formula> + UpdateTextBox()

- define javascript function like

function UpdateTextBox(){
   NWF$('#'+TextBox).val('Email');
   return "";
}

Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

Thank you.  This worked perfectly.

Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

Hi Marian,

I would like to use this example, but when I tried it didn't work for me.  I have obviously misunderstood something.

  • I updated my calculated value field to include the + UpdateTextBox()
  • I went to my form settings and put the javascript in, changing 'Email' the name of my text field
  • When I previewed the form the calculated field value didn't appear in the text field

Have I missed a step?

Thank you,

Christina.

0 Kudos
Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

above script was just an example how to 'simulate' resp. capture calculated control change event. and it just set "Email" string to text box.

if you want to set text box value to a value of calculated control control itsef  use something like following

UpdateTextBox(<Existing formula>)

function UpdateTextBox(inpval){
   NWF$('#'+TextBox).val(inpval);
   return inpval;
}
0 Kudos
Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

Thanks, Marian.  Forgive me, but this is really new to me and I'm unsure how to make this work.

So far I have added the first line to the calculated field so that it now reads:

I then copied the second part into the form settings.  I'm presuming I change the '#' for the name of the text field that I want to copy the calculated value in to, i.e.:

    function UpdateTextBox(inpval){
       NWF$('RiskRankingHSEScore'+TextBox).val(inpval);
       return inpval;
    }

Is this all correct?

THANK YOU!

0 Kudos
Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

everything is correct except of

            NWF$('RiskRankingHSEScore'+TextBox).val(inpval);

it should have been

NWF$('#' + RiskRankingHSEScore).val(inpval);

 

where RiskRankingHSEScore is javascript variable configured for text control, not its name.

if that still doesn't work or anything is still not clear I would suggest to start new question so that this thread doesn't confusing dealing with several different problems.

0 Kudos
Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

Hello Marian,  Can you check out my question on this configuration at: https://community.nintex.com/thread/18088-read-in-text-from-list-item-and-place-it-in-form-text-box

 

Thanks

0 Kudos
Reply
Workflow Hero

Re: Can't populate text control with calculated value

Jump to solution

checked

0 Kudos
Reply