Link to Document in Nintex Form


Badge +8

I have a form with a lookup to a document library. When a person selects a document to associate to the list item I want to then have a label populate with a clickable link to that document. I've searched the forum and can't find this solution. TIA!


15 replies

Badge +17

This is not native functionality for Nintex Forms. The list lookup does associate the item, but populating a clickable link is not something I've ever seen done to date. You may be able to accomplish this with javascript but I'm not entirely sure since the relative and absolute URLs aren't typically surfaced through the list lookup view.

Badge +8

I'm considering writing a simple workflow to populate the link. Once I've got it worked out I can add the functionality to an existing workflow.

Userlevel 5
Badge +14

it's not possible with a label but it's possible with calculated value control.

 

once you select a document from lookup dropdown, you basically know it's item ID. you can use the ID for one another lookup made with calculated value control and lookup() function to query for one of library item URL fields (eg. FileRef).

finally you just need to properly wrap lookup() function result up into a html snippet that makes up a valid clickable link. see eg. example - https://community.nintex.com/t5/Nintex-for-SharePoint/Add-variable-to-URL-on-Nintex-Form/m-p/64187/highlight/true#M53056

Badge +8

I will work on this solution today. Thanks!

Badge +8

I've got the calculated value pulling the link, and then trying to append the variable into the URL. I tired appending the relative URL to the domain address but had trouble with that too.

 

"<a href=" + calcLinkVar + """>Item Link</a>"

 

I get a page not found error with this code.

 

3036iE548B998F8E034D2.jpg

Userlevel 5
Badge +14

you miss there a starting apostrohpee for href attribute.

try 

"<a href=""" + calcLinkVar + """>Item Link</a>"
Badge +8

That does try to open, but then I get the option to open or save when I click the link. Then when I select open I get this message.

 

3057i2C3F5453E9BC59C7.jpg

FYI, the URL that I am using in the calcLinkVar variable looks like what I have pasted below. I suspect that is the problem, but I cannot get it to resolve without the .000

 

/sites/SiteName/Lists/ListName/3_.000

Userlevel 5
Badge +14

yes, sharepoint appends some digits to the URL field(s).

I hoped this would be easy to resolve :)

 

 

 

have a look on this example - https://community.nintex.com/t5/Nintex-for-SharePoint/Site-Workflow-Getting-list-Item-URL/m-p/11560/highlight/true#M9676

it's for a workflow, but in forms you can use replace() inline function with the same regular expression to stripp off URL tail.

 

 

Badge +8

Should I put the whole lookup function within the replace function, or just the FileRef attribute?

Userlevel 5
Badge +14

yes, you have to clean URL returned by lookup() function, FileRef is just attribute name

 

 

replace(lookup(.....),"_.d+$‍","")

 

 

Badge +8

@emha 

I tried that but still get the tail. This is so frustrating!

Badge +8

I wonder if the data type of the calculated value has something to do with it. I've tried generic and string. Doesn't seem to make a difference which one I use. Still get the numeric tail.

Badge +8

We decided to just use the OOTB functionality from view mode. The hot link is already there.

Userlevel 5
Badge +14

I tried that but still get the tail. This is so frustrating!


 

ah, sorry - to use regex within calculation formula you need to double backslashes

replace(lookup(.....),"_\.\d+$‍","")

 

 

Badge +1
Hello , can elaborate what do you means? how to achieve this

Reply