Hide an exsiting field, on a new form, based on a previous selection


Badge +7

I have 12 "yes/no" fields that are "available slots."  Once a person selects a "slot,"  I would like the "slot" that was selected not to display anymore on subsequent new items/forms.  I know how to hide directly on the form but this is more along the lines of hiding or disabling a field that someone else has selected.

Anyone have any thoughts or ideas for the most efficient way to achieve this?


12 replies

Badge +7

Use a calculated value for each slot with formula like

Lookup("List Name","Slot field Name","Value if True", "Any Field Name")

and then add a formula to each slot so if its related calculated value is empty, hide it.

BR,

Badge +7

I'm testing it today.  Will let you know how I make out.

Badge +7

I'm having trouble with the 4th parameter (output) in the string.  I'm selecting one of my fields/columns, that is a "single line of text" field, called "outcome," but I am not getting the results that I would have expected.

LookUpFormula

LookUpFormula1

LookUpFormula2

Badge +7

Did you try replacing Outcome with "outcome".

If yes and still doesn't work, please send me a screen shot of the browser dev console error since it's a REST call.

BR,

Badge +7

Hi Phillip,

Here is the formula:

lookup(List Name,Oct2018Slot2,"Yes","Outcome")

This is what it looks like before its checked:

LookUpFormula4

This is what it looks like when I check the box:

LookUpFormula5

Nothing on the console until after I uncheck the box and then this is what appears:

[Department Sites-d1ce0353-c428-411f-86f9-1b6c308fb03e] - Lookup runtime function is missing valid parameters. Check that the list name, filter column, filter value and return column are specified in the function. Parameters - list: Department Sites, filter column: false, filter value: Yes, return column: NWF.FormFiller.Functions.GetTypedValue('','Text')

Badge +7

Please try to remove the double quotes from  Outcome so it looks like:

lookup(List Name,Oct2018Slot2,"Yes",Outcome)

Badge +7

Hi Philip,

Thank you for your continued help with this.

I removed the qoutes and now, whether or not the box is checked, the field is not calculating at all:

LookUpFormula6

and here is the message from the console:

[Department Sites-54ab11ff-f52a-410a-b2bc-29dbfe79986d] - Lookup runtime function is missing valid parameters. Check that the list name, filter column, filter value and return column are specified in the function. Parameters - list: Bank Notes Department Sites, filter column: true, filter value: Yes, return column:

Badge +7

Just to make sure - "Oct2018Slot2" and "Outcome" are variables on the form containing the actual column names? I'm asking because they are look like references in the formula, but the formula actually expectes the names of the column(s).

Badge +7

I used the "Named Controls" fields rather than the "Item Properties."  I'll try using the "Item Property" fields since those fields are the actual column names.

Badge +7

Using the "Item Properties" field rather than the "Named Control" field did not net any different results.  Same results as the last post that I made :-(.

Userlevel 5
Badge +14

have a look on documentation on lookup() function

https://help.nintex.com/en-US/nintex2010/help/#Forms/RootCategory/Designer/Nintex.Forms.LookupFunction.htm%3FTocPath%3DF… 

its (short) syntax is like

lookup(“listA”, “ID”, 1, “Title”)

 

so, the first argument has to be the list name you want to get an item from. if you use 'ListName' reference variable the reference variable value gets first evaluated and resultant value gets passed in as a ListName parameter to the lookup() function. it doesn't play a role if you want to get an item from the list the form is running on. but if you wanted to get an item from a different list, reference variable wouldn't work since it would always evaluated to the current list name.

the second parameter is the name of list field you want to apply filter on.

the third parameter is the value you want to filter by.

the forth one is list field name which's value you want the lookup() function returns.

etc.

for all of these arguments the same applies for usage of reference variables, item properties or named controls - they first get evaluated and their values get supplied into the lookup() function. so if you eg. use 'Oct2018Slot2' named control reference, it would be first evaluated to true or false (assuming it's yes/no control) and so lookup() function would filter by a list field with name 'True' (or 'False'). so apparently this is not valid list field name. you have to type in list field name manually as a static string value.

reference variables as lookup() function parameters would only work if you wanted to filter dynamically by different list fields and you have had a control on the form (or possible a field in a list) that would hold a (valid) list field name you want to filter by.

Badge +7

Dina Fischer‌: if you recall your error-message ...

--- cut ---
Parameters - list: Bank Notes Department Sites, filter column: true, filter value: Yes, return column:
--- cut ---

This show just what Marian Hatala described:

  • the listname ist 'Bank Notes Deparment Sites' (this is probably right)
  • the filter-column-name is 'true' (this doesn't look right)
  • the value you're searching for is 'Yes' (this is right)
  • the column to actually retrieve is empty (this doesn't seem right)

So you might want to not use the named-controls for the filter-column and the lookup-column, but instead you want to use literal strings like "Oct2018Slot2" and "Outcome" instead.

Reply