alan_coulter
Rookie

New Responsive Form Designer - Variables to retrieve data from other list preventing Submit

I am building a travel request form using the new responsive designer, and I've come across an issue which is preventing the form from being submitted (underlying JavaScript error "TypeError: Cannot red property 'results' of null").

TypeError.png

Essentially there is a list for Traveller Details, which stores the traveller's Qantas FFN plus other FFNs. When the user first fills this information in within the travel request form, if the 'Save Preferences' toggle is Yes, the workflow will either create or update an entry for the traveller in the Traveller Details list (i.e. to capture preferences for any future travel).

 

In my current Traveller Details list, I have the following current values:

QantasFFN : 1234567

VirginFFN: <empty>

OtherFFN: <empty>

OtherFFNOrg: <empty>

 

I have created form variables to run in new/edit mode to retrieve these preferences. Each variable has the following syntax:

 

ifElse(isNullOrEmpty([Form].[Employee]),"",lookup("Traveller Details","Email Address",userProfileLookup([Form].[Employee],"WorkEmail"),"VirginFFN"))

 

If I place labels on the form and attach it to these variables I can see that QantasFFN has a value, but the others are empty (which is what I expect). However, when I go to submit the form, I can see that the variable is firing and throws the above error. The pretty print of the location of the error (within UFRuntime.aspx) is as follows:

JavaScriptPrettyPrint.png

 

If I change the Traveller Details FFN fields to each have a value, then the form variable no longer fails and it will submit. 

Please let me know if there is a work around for this issue, as it is key piece of functionality for the travel request form.

0 Kudos
Reply
1 Reply
alan_coulter
Rookie

Re: New Responsive Form Designer - Variables to retrieve data from other list preventing Submit

Just an update on this one...I worked around the problem by configuring my workflow to store the value 'Not Specified' against each FFN that I store in the Traveller Details list (i.e. to recall for future travel requests). I had originally setup my form as follows (using toggles to show/hide the FFN fields) and I had rules to populate the FFN values if their corresponding toggle was Yes:

originalform.png

What I really wanted was to also pre-populate the toggle value based on 'HasFFN' type boolean values stored in my Traveller Details list (i.e. so that when the form loads, if the user has an FFN then the toggle is set to yes and the value displayed). Unfortunately you cannot set the toggle value using a rule (that calls a variable). Furthermore, if the variable worked with boolean values I found that I could once again not submit/save the form. Below is the formula I had used, which caused the issue (note that there is no 'IsEqual' or IsTrue/isFalse type functions, so I had to use startsWith):

 

ifElse(isNullOrEmpty([Form].[Employee]),false,startsWith(lookup("Traveller Details","Email Address",userProfileLookup([Form].[Employee],"WorkEmail"),"HasQantasFFN"),"true"))

 

String based variables did work, but the rule once again would not change the toggle value:

ifElse(isNullOrEmpty([Form].[Employee]),"false",lookup("Traveller Details","Email Address",userProfileLookup([Form].[Employee],"WorkEmail"),"HasQantasFFN"))

 

As the toggle setting on load wouldn't work, ultimately I had to get rid of them. The resulting form (which works) looked as follows:

newform.png

0 Kudos
Reply