Append Unique ID to URL Link?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

Hello,

Is it possible to append a unique ID to the end of a URL based on user?

For example, I have a survey link that I would like to append an employee ID to based on the user that is logged in and clicking the link.  Employee ID is [RelatedEmployee] in my QB.  However, it does not seem that the system can differentiate between the URL and the [RelatedEmployee] function, since it looks at [RelatedEmployee] as part of the link instead of including the actual employee ID.

E.G.http://www......participantId=00123  instead of http://www.....participantId=[RelatedEmployee]

The survey in question needs a unique identifier attached to each response submitted for metrics, but I'm not even sure if what I'm asking for above is possible.  The link is displayed for everyone in the employee role view after they submit a document.

Please let me know if I'm not making sense on the above.

Thanks so much for your assistance!

Photo of bintu85

bintu85

  • 90 Points 75 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,678 Points 20k badge 2x thumb
(Assuming the Survey is actually a record within QB)

You have to make a formula - URL field. and have that be the link sent.

at some point in for formula, usually after the [Record ID#] you will need to add more details, saying you want the user, or user id, to be inserted in a particular field.  in this case field ID 22.

It amends your formula to change a field for you, so even if they click the link, QB should understand it for the current user

...&Dbid()&"?a=API_EditRecord&rid="&[Record ID#]&_fid_22="&URLEncode(User())&"


This may not solve your problem, do you have more details of what you are looking for?
Photo of bintu85

bintu85

  • 90 Points 75 badge 2x thumb
Hi Matthew,

Thank you for the response.

The survey is actually an external tool that my company uses and the link takes you to an outside url.  The request is that the employee ID (unique identifier) be appended to the end of the url (as seen in my original post where [RelatedEmployee] = EEID).

I've tried coding it so that it amends the [RelatedEmployee] formula at the end of the url to actually display the EEID instead once you click on the link, but so far nothing has worked.

Because the link is external, I wasn't even sure if it would be possible at all to do.

I appreciate your help!
Photo of Matthew Neil

Matthew Neil

  • 31,678 Points 20k badge 2x thumb
try this at the end of the existing link.
...website.com/...participantid="&[EEID]&"
You'll need to make that [EEID] be the id code, and connected to the related employee/table you are using.
Any other details you have if that doesn't work?
Photo of bintu85

bintu85

  • 90 Points 75 badge 2x thumb
Hi Matthew,

Success!  That did the trick.  Thank you kindly for the additional information.  I think I had tried a combination of that earlier but forgot the ampersands within the quote code at the end.  My survey link is now behaving exactly as I want it to.

Thanks again!