Home › Forums › Cascading dropdowns › Refresh cascade when a new item is added
- This topic has 7 replies, 3 voices, and was last updated 6 years, 1 month ago by Alexander Bautz.
-
AuthorPosts
-
-
August 29, 2018 at 21:58 #21976
I am using a vLookup to add a new item to a cascade list and would like to get the cascade field to update when the new value is added. The vlookup works perfectly to add the new item, but how do I get the cascade field to update and see the new value?
-
August 30, 2018 at 21:01 #21999
There is not built in method for refreshing it automatically, but you can use the callback from vLookup. To do this, you must use this approach to initiate it in Custom JS and not use the dedicated Cascading dropdown tab in DFFS:
https://spjsblog.com/dffs/dffs-plugins/spjs-cascading-dropdowns/#Invoke_the_function_manuallyHere is a quick mock-up (not tested so might contain typos):
function initMyCasc(){ spjs.casc.init({ ... ... }); } // Call the function initially initMyCasc(); function vlookupChildAddedCallback(){ spjs.casc.kill("FieldInternalName"); // use first field in thisListFields array initMyCasc(); }
Let me know how this works out.
Alexander
-
September 11, 2018 at 22:26 #22064
I’d like to have this same functionality with DFFS Cascading Dropdowns, i.e., the cascade field AND associated cascade fields refresh when the lookup list item is updated.
-
September 15, 2018 at 11:01 #22105
Hi Mike,
I don’t understand exactly what you mean – can you clarify it a bit more?Alexander
-
September 18, 2018 at 21:00 #22127
No problem. Here’s an expanded description.
I have two lists related by Cascading dropdowns v3.7.22 in DFFS. There is a field in the lookup list from which I select a value using a pulldown in the current list. Since these are all text fields, and do not use the SharePoint OOTB lookup capability, there is no active link between the two lists. This means that when the value I selected from the lookup list is changed in the lookup list it is not automatically changed in the current list. I would need to de-select and re-select the lookup value in the current list pulldown to refresh it.
I would like the value selected from the dropdown in the current list to change to the updated value, i.e., automatically reflect changes in the lookup list (basically operate as the OOTB SharePoint lookup functionality)
Thanks for your help.
-
September 23, 2018 at 11:30 #22179
I see, unfortunately this is not possible to do because there is (as you already mentioned) no link between the text values in your current list that identifies the item in the lookup list. This means the when the lookup list is changed, there is no way to identify the elements in the other list to update their value.
You might be able to use SPServices – https://sympmarc.github.io/SPServices/value-added/SPCascadeDropdowns.html
Alexander
-
September 25, 2018 at 01:04 #22197
My lookup list exceeds the SharePoint Threshold Limit of 15,000 records (in-house limit) which made your DFFS Cascading dropdown REST API solution so valuable as it works with almost any amount (46,000 records at this point!).
Unfortunately, SPServices (which we used previously) is constrained by the same Threshold Limit. I thought you might have a custom Javascript solution similar to the vlookup solution you posted above.
Mike
-
September 25, 2018 at 23:09 #22205
I see. Unfortunately I don’t have a good solution to this. I guess it would be possible to write the ID of the list item selected by the cascading dropdown to a hidden text field, but you would need a workflow to trigger on change of the lookup list item to identify all the items linking to it and loop over then to update the value. I don’t think this will be a very elegant solution, but it might work.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.