I am still using our trial version of Forms. I need to be sure all of the functions we need will work prior to purchase.
In a form, I am trying to use the "Extra Fields" and "Expand" properties of a three field cascading lookups.Below is an example:
List one: "State" shows all states
List two: "City" shows a list of cities filtered using "Depends on" by the selected State
List three: "Hotels" shows a list of hotels filtered using "Depends on" by the selected City
I want to show the "Street Name" of the Hotel in List three. It is saved in the Hotels Source Data list.
However, in List three, when I add fields (Address, Hotels/Id) to the "Extra Fields" and/or (Hotels) "Expand" properties, my List three returns empty. Removing the fields (Address, Hotels/Id) from "Extra Fields" and the field (Hotels) from "Expand" allows my three cascading lookup control to properly function.
Can you help me sort this out? I have ready through multiple sets of instructions on this site as well as several other posts that I thought might be helpful, but I just don't understand exactly how all of this ties together yet.
Does the cascading drop downs work? Do you see options in the last drop-down?
What do you mean by 'being displayed'? If you want to display the extra column value, you must use the code.
For instance, if you want it to be displayed somewhere on the form, you need to add this code to the form:
fd.field('Hotels').$on('change', function(value){
//populate Address field with the Extra field value
fd.field('Address').value = fd.field('Hotels').value. Address;
});
Have you added Address field to the Extra field property only on the Edit form? Please share the screenshot of the form and the errors in the browser console.
For this you need to use the code as described in the View configuration section. But first we need to make sure that the extra field is loaded for the Hotels field.
Hello,
I got the New, Edit, and Display forms to work with the cascading drop-downs finally. I did add "Address" as an "Extra Field" in the "Hotel Name" drop-down. However, I am not seeing the Address displayed with the Hotel Name in the drop-down box on the form.
I have attached several screenshots: the definition of "Hotel Name" field, my json from the "New" form, my CSS from the "New" form, and a capture of the design of the "New Form" with the properties of the "Hotel Name" field displayed. I ONLY have "Address" in the "Extra Fields" property. There is nothing in the "Expand" field.
I appreciate your time and assistance with getting this to work. I am still on our trial license, so very new, but trying to prove the concept in order to purchase.
The value/ID of Fachgebiet is used as filter for Berater. Filterterm in Javascript is like this:
Aditionally I have to filter the field Berater by the value of a boolean-field in the list Berater called "aktiv". Therefore I use the extra-fields of lookup on Berater.
Is that correct and how can I pass the value of aktiv to javascript and use it in the filter-term? How would the filter-term look like?
I have tried a lot of different options trying to get this to work. Can you help me understand the following?
In the JS, in spBeforeRender, when forming the template, what is the data.LookupValue supposed to represent, or is it just as shown?
In the JS, what is the data.Address pointing to? The lookup field name(HotelName), the Extra Fields(in HotelName), or the original list that Address comes from (Hotels).
In the JS, I have fd.control('HotelName').widgetOptions...... is that correct?
Where in the JS should the below be placed? spBeforeRender, spRendered (before or after the call to populateFields), or in the function populateFields?
fd.field('Hotels').$on('change', function(value){
//populate Address field with the Extra field value
fd.field('Address').value = fd.field('Hotels').value. Address;
});
In the code in #4, 'Hotels' is the name of my list which does contain the field Address. The field on my Form HotelName is a lookup to the list Hotels. Is the above correct?
For the Address field on my form, does listing "Address" in the Extra Fields of HotelName satisfy the requirement to have the field on the form?
When I add any values other than "Address" in the Extra Fields property of the HotelName field on my form, the drop-down values in HotelName do not populate.
If I add any values at all to Expand, the HotelName field on my form, the drop-down values in HotelName do not populate.
From the error messages I can tell that the Address is a valid column name, but the Hotels HotelName are invalid column names. Please share the screenshot of the source list and teh screenshot of the column properties with the page URL like so:
Lookup value includes the ID of the selected title and the display text that user sees in teh drop down. data.LookupValue is a display text of the selected option.
It is the value of the Extra column.
Yes, this is how you change the field template. See the example.
This code must be inside the spRendered() function. Outside of the populateFields() function. Just noticed that the syntax in the populateFields() function is invalid. Please share teh code as a plain text so I could fix it for you.
You must use the internal names of the fields in the code:
No, when you add a column name to teh Extra fields you just pull the data from the list. If you want it to be displayed on teh form, you can add a common text field and populate it using the code you've shared:
fd.field('Hotels').$on('change', function(value){
//populate Address field with the Extra field value
fd.field('Address').value = fd.field('Hotels').value. Address;
});
You must enter the valid column name. Please share the screenshot of the columns settings that you want to list in Extra fields with the page URL to identify its valid internal name.
Hi .... I decided to go ahead and post the requested screenshots here. Thank you in advance for your assistance. Rhonda 20230830ExtraFields.pdf (1.1 MB)