Vlookup – feed Totals from Vlookup table to Parent on saving/updating child

Forums vLooup for SharePoint Vlookup – feed Totals from Vlookup table to Parent on saving/updating child

Viewing 7 reply threads
  • Author
    Posts
    • #33878
      Gulbinder Sandhu
      Participant

      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:
    • #33911
      Alexander Bautz
      Keymaster

      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

    • #33912
      Gulbinder Sandhu
      Participant

      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

    • #33915
      Gulbinder Sandhu
      Participant

      image attached

      Attachments:
    • #33919
      Alexander Bautz
      Keymaster

      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

    • #33942
      Gulbinder Sandhu
      Participant

      Hi Alexander,

      Still no luck.

      Could it be the underscore in ‘Vlookup_Samples’ is causing an issue with the jQuery?

      Thanks

      Gul

    • #33944
      Alexander Bautz
      Keymaster

      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

    • #33946
      Gulbinder Sandhu
      Participant

      Thank you

Viewing 7 reply threads
  • You must be logged in to reply to this topic.