Is Hyperlink in VLookup possibe

Forums vLooup for SharePoint Is Hyperlink in VLookup possibe

This topic contains 10 replies, has 3 voices, and was last updated by  David Jeremias 4 months ago.

  • Author
    Posts
  • #9229

    jstadick
    Participant

    Hi, I would like to know if there is a way to make a field/column in the vlookup a hyperlink. I have one use case where I would like the ID column of the field to hyperlink to a custom webapp that generates a PDF. The second use case is to hyperlink an email address.

    Thanks for any ideas.

    John

  • #9253

    Alexander Bautz
    Keymaster

    Hi,
    Add a “dummy” field to your vLookup config like in this image:
    IMG

    And then use this code in the Custom JS:

    function getHyperlink(fin,item){
    	return "<a href='https://spjsblog.com?MakePDF=1&ItemId="+item.get_item("ID")+"' target='_blank'>Make PDF</a>";
    }

    Obviously you need to change the URL, but you get the idea.

    Let me know if the “dummy” field gives you an error – I cannot remember which version I added this option…

    Let me know how this works out.

    Alexander

  • #9256

    jstadick
    Participant

    Thanks for the help Alexander. I don’t get an error when adding the dummy field, but the vlookup just fails to load, and all vlooks after it on the page fail.

    I’ve got DFFS backend v4.2353, vlookup backend v2.002, spjs-utility version 1.205.

  • #9258

    Alexander Bautz
    Keymaster

    I checked the change log, and saw support for the “function” in the “special configurations” textarea was added in v2.251.

    This means you must update your vLookup FRONTEND to this version or later.

    You can bring up the developer console (hit F12 > Console) to look for error messages, but I guess your current version complains about the “[dummy field]” not being a proper field.

    Alexander

  • #9263

    jstadick
    Participant

    To upgrade, can I just replace the _min.js file(s)?

  • #9265

    Alexander Bautz
    Keymaster

    Yes

  • #9549

    jstadick
    Participant

    We finally got DFFS upgraded and this solution works great.

    Thanks again Alexander,

    John

  • #9567

    Alexander Bautz
    Keymaster

    Thanks for the feedback. I’m glad it worked out.

    Alexander

  • #24323

    David Jeremias
    Participant

    Hey Alexander – Would it be possible to make this vLookup hyperlink open in a modal window?

    Thanks!
    David

  • #24334

    Alexander Bautz
    Keymaster

    Yes, just change the Custom JS snippet like this:

    function getHyperlink(fin,item){
        var url = "https://spjsblog.com?MakePDF=1&ItemId="+item.get_item("ID");
        return "<a href='javascript:void(0)' onclick='openInDlg(\""+url+"\")'>Make PDF</a>";
    }
    
    function openInDlg(url){
        var options = {
    		"allowMaximize": true,
    		"showClose": true
    	};
    	SP.UI.ModalDialog.commonModalDialogOpen(url, options, function (result) {
    		if (result === 1) {
    			// Dialog was saved
    		}else{
    		    // Dialog was closed without save  
    		}
    	});
    	return false;
    }

    Alexander

  • #24363

    David Jeremias
    Participant

    Thanks Alexander! Worked perfectly.

You must be logged in to reply to this topic.