Form Variable - Item Look up Based on Current User Name

  • 25 March 2020
  • 3 replies
  • 5 views

Badge +1

Hi everyone,

I am trying to create a form variable and apply it to a value in my form that will ultimately display a PDF document that is specific to the current user viewing the form.

The PDF files will be named the same as their log on or current user name. For example, firstname.lastname. And theyre all in the same location.

Can someone help me out with the right formula for this variable? I have pulled information from lists before, using list lookup, but i am unsure of how to pull information from a list based on the name of the item.

Thanks in advance!


3 replies

Userlevel 6
Badge +22
I would add a Label control and in that label control insert a link.
The link would look like:
https://SharePointSite/Subsite/Library/{Common:CurrentUser}.pdf

The label control will then have a link to the current users PDF file.
Havent tested but it should work.
Badge +1

Thanks Simon. I'll give that a try and get back to you!

Badge +1

Hi Simon,

 

Sorry for the late reply. I've had a chance to test it out using a label control, which would be ideal, however now when I pull the Current User information it pulls information from our server as well. So it breaks the URL. Example: http://sitenamei:0#.w|servernameallison.larkin.pdf

 

I'm wondering if I could make a form variable. I have a variable already to pull the employee's name. Wondering if I can plug that in to a new variable that looks up the link. For example, I've tried something like this: lookup(http://sitename.com/EmployeeName.pdf) . But must be wrong because it spits out a blank preview.

 

Thanks in advance!

Reply