vLookup Relative URL (link to parent from child)

Forums Dynamic Forms for SharePoint vLookup Relative URL (link to parent from child)

This topic contains 6 replies, has 2 voices, and was last updated by  Alexander Bautz 2 weeks, 2 days ago.

  • Author
    Posts
  • #25445

    Paul Lynch
    Participant

    Hi Alex,

    Starting to build a new form and use vLookup and very rusty.

    Setup my Parent and Child and all working great.

    ISSUE – Looking to prepopulate a HyperLink field in my child form, which links back to the original record (uses the ID column) and a URL string.

    Please attached image for my config and what I get. Which is the URL, but no ID. I am not sure what parameters to set to get the right result.

    The result of this is I get exactly the below URL without the actual ID number just [id].

    https://jnj.sharepoint.com/teams/gcoiti/Lists/Parent/DispForm.aspx?ID=[id]

    So what do I need to change to put the parent’s ID in the URL?

    PS – would be nice if there is a way that I could populate the description field separately too (with a fixed phrase like “click to see more details”)

  • #25447

    Paul Lynch
    Participant

    sorry forgot the attachment!

    Attachments:
  • #25468

    Alexander Bautz
    Keymaster

    Hi,
    I see that the text in the help dialog is a bit ambiguous, but what I meant to write is to use ItemRelURL in the From field and this will give you the correct relative path to the item.

    Unfortunately you cannot set the text part of the URL field directly, but you should be able to use something like this in your child form NewForm (in Custom JS):

    jQuery("#dffs_LinkToParentItem input:first").val("click to see more details");

    Replace LinkToParentItem with your field internal name.

    Alexander

  • #25554

    Paul Lynch
    Participant

    Thanks for this info!

    Sorry to piggy back this thread – but my vlookup table (in the parent form) is suddenly no longer rendering/appearing, just disappears as it loads.

    The child items are still being created though.

    I’ve tried re-creating the vlookup but no luck.

    I’ve remove any and all CSS in DFFS, on the page, and stripped back all settings to very basics? (there is no jquery either I could not get your code above to work). I also removed all the pre-populated child fields.

    Is there a way I can debug/troubleshoot this?

    • This reply was modified 2 weeks, 3 days ago by  Paul Lynch.
    • This reply was modified 2 weeks, 3 days ago by  Paul Lynch.
  • #25563

    Alexander Bautz
    Keymaster

    Sounds strange – do you have any custom function calls in the vLookup configuration? – I’m not sure how this could break it though, but you never know.

    Try inspecting the placeholder where your vLookup table should have been (right click > inspect) and look in the HTML to see if it is still there, but somehow hidden.

    You can use vLookupDebug=1 in the url like this to see that the script actually runs:

    .../Lists/DFFS_TestList/DispForm.aspx?ID=51&vLookupDebug=1

    Alexander

  • #25583

    Paul Lynch
    Participant

    Thanks! With the help of the debug it became clear it was something to do with the Prefill values in child as it was returning 0 results because the parentID field was not being populated, so no results were appearing.

    Now working (sorry changed so many things at once before working I cannot say exactly what I did wrong to help future users).

    Below is the final piece of the jigsaw to get this form ready..

    jQuery("#dffs_LinkToParentItem input:first").val("click to see more details");

    Replace LinkToParentItem with your field internal name.

    My steps:
    1. My prefill child works (ItemRelURL, and it prefills a relative link which is accurate.

    2. This relative link (format /teams/gcoiti/Lists/Parent/DispForm.aspx?ID=8 goes into a multiline of text rich text field. But it does not appear as a link just text. Should I use another column type?

    3. This column has internal field name of “Linktoform”

    4. I go into the child DFFS settings, and in the custom tab I entered

    jQuery("#dffs_Linktoform input:first").val("click to see more details");

    5. But still the none clickable Relative URL shows up in the column Linktoform (in list view which is ideally where I want to show it) and child item display form (which is not so important)

    Wondering if I could get bit more help to make this work?

  • #25589

    Alexander Bautz
    Keymaster

    If you want to write a link to a multiline rich text field you must write it like this to make it clickable:

    setFieldValue("Linktoform","<a href='/teams/gcoiti/Lists/Parent/DispForm.aspx?ID=8 '>Clickable part of the link</a>");

    Alexander

You must be logged in to reply to this topic.