Skip to main content
Nintex Community Menu Bar

How to populate form fields with calculated values

  • October 29, 2020
  • 18 replies
  • 502 views

MikeCrawford
Forum|alt.badge.img+3

This should be dead easy, and likely solved 1000 times before, but I'm trying to get various user profile attributes to populate various form fields. I am able to put calculated fields on the form, and those work great, but how do I put the calculated values into the form fields? I have tried naming the calculated fields, but can't set the form fields. I've tried connecting the calculated fields to the form fields, but that doesn't work either. This seems like it should be exceedingly simple. What am I missing?

18 replies

Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • October 29, 2020
Hi,

Based on your screen shots you have your controls on the left bound to the SharePoint columns and you have a calculated control also bound to the same column. This means the calculated column control will populate the column and the columns on the left will clear the columns.

MikeCrawford
Forum|alt.badge.img+3

But the columns on the left are not populating. How do I get them to populate?


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • October 30, 2020
If you are getting the same information in a calculated value why do you need both sides to populate?

MikeCrawford
Forum|alt.badge.img+3

The fields will be sent via an email notification (workflow) to an external entity. I need to have the values recorded in the list so the workflow will work (and presumably flow!)


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • October 30, 2020
I get that but you dont need to have the information in the controls on the left and the calculated controls especially if both sides are connected to list columns.

MikeCrawford
Forum|alt.badge.img+3

I'd love to remove the calculated fields, but how do I get the values to populate in the list fields?


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • October 30, 2020
Put the same formula in the default field of the left hand controls configuration and then remove the calculated value controls.

MikeCrawford
Forum|alt.badge.img+3

I tried that initially but it puts some horrendous guid in the field.


MikeCrawford
Forum|alt.badge.img+3

I'll keep experimenting and will pull screenshots if I can't get it. Thanks so much for your help, @SimonMuntz 


MikeCrawford
Forum|alt.badge.img+3

This is what the form returns when the default value of the form field is the calculation. I have removed all of the calculated fields.


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • October 30, 2020
Show me a screen shot of the control configuration where you have put the formula.

As the calculated values are working cant you just keep those and get rid of the left hand controls?

MikeCrawford
Forum|alt.badge.img+3

Here is the field configuration.

The calculated fields are working, yes, but I must have the values inserted into the list, because they are absolutely necessary for the email that is sent with that information. Does that make sense? What am I missing?


MikeCrawford
Forum|alt.badge.img+3

So, the question that remains is; how do I populate the list with calculated values?


Forum|alt.badge.img+12
  • Scholar
  • November 3, 2020

@MikeCrawford It seems you need Name, Email, Phone & Title field and you're using user profile lookup function in calculated control. 

 

All you need to do is remove SLT controls and just keep Calculated Controls. Make sure in Connected To option in Calculated control they are connected to a respective SharePoint list columns.


MikeCrawford
Forum|alt.badge.img+3

I appreciate that, @kunalpatel, but I would much prefer to have the fields populated as a default in case the user needs to update a phone number. It may not surprise you that our AD information is often spectacularly out of date, particularly with people working from home. How do I get the calculated values into the form fields?


MikeCrawford
Forum|alt.badge.img+3

I have opened a support ticket with Nintex and will post results here when (if!) we have a resolution. Thanks, everyone who has helped thus far!


Forum|alt.badge.img+12
  • Scholar
  • November 6, 2020

@MikeCrawford can you try the below steps:

 

  1. Add SLT control on the form but do not connect it to any list columns
  2. Name that SLT control e.g. slt_EmpPhNo
  3. Add calculate control and connect it to SP list column
  4. Name it calc_EmpPhNo
  5. Now instead of using just the user profile lookup function, use the If statement i.e. If slt_EmpPhNo is null or blank then in the true portion use user profile lookup, and in the false portion use slt_EmpPhNo

As an enhancement, I will not keep SLT control and calc control side by side, instead I'll add a check box below calc control asking to check if the phone # is incorrect and if they check then it will display the SLT control.

 


MikeCrawford
Forum|alt.badge.img+3
  • Author
  • November 10, 2020

Absolutely brilliant, @kunalpatel - this is exactly what I need.

Step 5 calculated value looks like this: If(isNullOrEmpty(EmployeeName),UserProfileLookup(User,"PreferredName"),EmployeeName)

Additionally, the checkbox is a great addition for a robust form when fields might need to be manually overridden.

Thank you!