Home › Forums › vLooup for SharePoint › Vlookup – feed Totals from Vlookup table to Parent on saving/updating child
- This topic has 7 replies, 2 voices, and was last updated 3 years, 4 months ago by Gulbinder Sandhu.
-
AuthorPosts
-
-
June 25, 2021 at 12:16 #33878
I have vlookup on the parent that users fill in some child docs on a 2nd list.
Is there a way I could feed the totals (as highlighted) into 3 fields on Parent list on saving the parent doc ?
I would like to do this when the user creates or edits the vlookup from the parent form dialog.
Attachments:
-
June 26, 2021 at 09:41 #33911
Hi,
You must use some custom js – here is an example that gets the value from the 6’th column of a vLookup table (the table cells are 0-indexed so the number 5 refers to the 6’th td in the tr):var val = jQuery(".vLookup_total_vLookupTasks:eq(5)").text(); setFieldValue("Your_field_name", val);
You must replace “vLookupTasks” with the name of your vLookup column.
Just repeat the two lines for the other two fields you want to set.
Alexander
-
June 28, 2021 at 09:21 #33912
Hi Alexander,
I tried the suggestion but had no luck.
var val = jQuery(“.vLookup_total_Bacti:eq(5)”).text();
alert(val);
setFieldValue(“Bacti”, val);name of your vLookup column – do you mean column header name in table or the name of my vlookup?.
e.g my vlookup is called Vlookup_Samples rather than vlookupTasks
-
June 28, 2021 at 10:21 #33915
image attached
Attachments:
-
June 28, 2021 at 15:57 #33919
If your vLookup is named “vLookup_Samples” the code should be something like this:
var val = jQuery(".vLookup_total_vLookup_Samples:eq(5)").text(); alert(val); setFieldValue("Bacti", val);
Alexander
-
June 29, 2021 at 09:22 #33942
Hi Alexander,
Still no luck.
Could it be the underscore in ‘Vlookup_Samples’ is causing an issue with the jQuery?
Thanks
Gul
-
June 29, 2021 at 11:54 #33944
Hi,
I should have mentioned this before, but just right click the total you want to get the value from – select “Inspect” and look at the class attribute in the HTML code in the developer tools that open (there are two classes split by a space – use the last classname).Alexander
-
June 29, 2021 at 12:11 #33946
Thank you
-
-
AuthorPosts
- You must be logged in to reply to this topic.