LedLincoln
Design Dabbler

New Responsive Form - Can't put form variable into formula

This has been frustrating for me because it seems it should be simple. I have a form with a list lookup control that links to a parts list in the same site. The user can select a part number using that control. What I would like is to have a read-only text control that auto-fills the part description, based on the part number selected. Seems to me this formula would be the logical way to accomplish this:

Lookup("Parts", "Part Num", Form.Part, "Description")

...but Nintex does not allow me to insert a value from another control nor from a form variable into the Form.Part part of the formula.  What am I missing?

 

 

 

Labels: (1)
0 Kudos
Reply
5 Replies
David-
Forms Fledgling

Re: New Responsive Form - Can't put form variable into formula

You are pretty close in your formula. You just need to change one thing from what I can see. This is one I have that looks up the address for a customer.

 

lookup("Customers","ID",parseLookup([Form].[Customer Lookup],false),"Address")

  • Customers is the list where the data is located
  • ID is the list item ID for the item selected in the drop-down
  • Now this is what you are missing:
    • You need to add a parseLookup function to your form field and set the return value to false, which will return the ID of the item in the list.
  • Address is the field I want to return and populate on the form

 

However, for your scenario, since you want to match on "Part Num" for the lookup, you need to change the parseLookup to true, which will return the value in the field instead of the ID of the selected item in the drop-down. If your Part Num field is an integer, you will need to modify the parseLook to convert it to a number. For example, convertToNumber(parseLookup([Form].[Part Num],false)).

0 Kudos
Reply
LedLincoln
Design Dabbler

Re: New Responsive Form - Can't put form variable into formula

David - Thanks for your quick reply. parseLookup seems promising, but I'm running into the same roadblock. I cannot insert the list lookup control into the formula - it's not in the list of variables from which to choose (it only has SharePoint columns, Context, or Form mode), and if I try to type [Form].[SelectPart], the parser tells me "the function requires a 'string' type of parameter." and "Variable '[Form].SelectPart]' cannot be found." For simplicity, I'm just trying this:

parseLookup([Form].[SelectPart], false)

...and I see those errors. It's almost as if there's something wrong with my list lookup control. (?)

Trying another approach, I created a form variable called varPart with the value [Form].[SelectPart], and that appears to work. Trouble is, I can't figure out how to make use of the form variable.

 

0 Kudos
Reply
David-
Forms Fledgling

Re: New Responsive Form - Can't put form variable into formula

It sounds like what you have is correct. You might try wrapping your entire formula in a convertToString function. It seems like the data you are looking up might be a different data type than the field you are trying to populate. By wrapping your formula in the convertToString function, it will ensure it returns a string.

 

  • convertToString(lookup("Customers","ID",parseLookup([Form].[Customer Lookup],false),"Address"))

 

Good luck!

0 Kudos
Reply
LedLincoln
Design Dabbler

Re: New Responsive Form - Can't put form variable into formula

Is there something fundamentally wrong with my form?  The documentation for parseLookup suggests that I can insert my list lookup control, but it won't accept any form of the blue parameter.

parselookup.png

On mine, I think it should be [Form].[SelectPart], but there seems to be no [Form] object available to me.

One other point: This is a list form, not a workflow form, if that matters.

0 Kudos
Reply
LedLincoln
Design Dabbler

Re: New Responsive Form - Can't put form variable into formula

I'm getting closer, thanks to Euan Gamble's video (https://www.youtube.com/watch?v=aa1JM3vEhxY). I can do the lookup successfully in a form variable, then insert that variable into a label control. My formula is

lookup("Parts", "ID", parseLookup([Form].[SelectPart], false), "Description")

My remaining problem is that I would like that result to be in a bound control, so that it is saved to my list. Evidently, I cannot insert either that variable or that formula into a text control bound to the list's Description column (or even unbound). If you can have another suggestion, please share.

And, thanks for your help!

In this video, we look at how to use the Lookup and ParseLookup functions with the Lookup control in Nintex New Responsive designer for Nintex Forms for Offi...
0 Kudos
Reply