cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can you edit a calculated value field?

Jump to solution

I am creating an order form and I want to pre-populate data in the form to streamline the process but I also want the user to be able to edit if it is not accurate. I can use a calculated value to pull the information I need via the userProfileLookup but once it is in the form it can't be changed. I can't figure out how to add that same calculated value to a single line text box as well. Is this possible to do? Any thoughts or suggestions would greatly be appreciated.

 

Thank you,

Josh

Labels: (2)
Reply
9 Replies
Not applicable

Re: Can you edit a calculated value field?

Jump to solution

I'm no expert in Nintex forms (im an infopath forms developer) but but you should be able to set a default 'calculated' value, but as a default value it can be changed.

0 Kudos
Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

Hi Josh,

It's not possible to update calculated control's value but you can show calculate control's value into textbox. You will need to write some custom javascript in order to achieve this.

I have attached sample exported form for you, please import that form and see if that's what you after.

Let me know if any issues.

Note: Please note that, this is just custom script, Nintex support will not be able to provide any support for that.

Regards,

Shirin

Reply
Not applicable

Re: Can you edit a calculated value field?

Jump to solution

Hi Shirin,

Thank for the information, that definitely pointed me in the right direction. I was able to write some custom javascript to pull from SPServices to get the info I needed to the single line text box.

Thanks again!

-Josh

0 Kudos
Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

I had encountered a similar problem and this works well for me.  I do have one question, though. If I change the value in the text field and save the form the edited value is saved, as expected, and shows up correctly in View mode.  However, if I try to edit the form the javascript is executed again and the calculated value is once again copied into the text field.  Is there a way to make this work in new mode only so that once I've made edits to the text value it is not overwritten when I make edits to other parts of the form?

Another way to ask this: is there a way to determine which mode I'm in within the javascript so that I can execute this function conditionally?

Thanks,

Bruce

0 Kudos
Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

Ooops! I found the answer 5 minutes after asking it. Leif Frederiksen provided the answer for me: 

     if ({Common:IsNewMode}) {....

which is exactly what I was looking for.  See https://community.nintex.com/message/1453.

Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

Shirin:

Thank you for this helpful code.  It works great for me when the form loads and values are calculated in the form for the first time.  However, I cannot get this to work when one of those values changes.  Probably this is because the javascript executes only once (within the NWF$(document).ready() function).  I'm looking for a way to make sure the text field updates whenever the calculated field changes. I've tried the JQuery change() function to accomplish this but can't seem to get it to work.  Any suggestions?

Thanks,

Bruce

0 Kudos
Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

Hi

I have tried to use your custom javascript and can see how it works with your example but when I change it to use userProfileLookup(Current User, "PreferredName"), the name does not appear in the text box.  It appears blank.  I have used your exact form to test it so the code should work. It works if I use other functions.  Your help is greatly appreciated.

Regards

Renee

0 Kudos
Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

Hi Bruce Altner‌, did you ever get this to work? I'm having the same issue and I want to have a calculated field update in runtime (so not only once when the form is first create) and the users should be able to edit it before they save. Any ideas Shirin Patel‌ ?

0 Kudos
Reply
Workflow Hero

Re: Can you edit a calculated value field?

Jump to solution

Hi Christine,

I am really sorry, I didn't get your issue completely. Can I please request you to give me the exact scenario so I can try and replicate for you?

Thanks.

0 Kudos
Reply