Hyperlink to Email Person on Form

  • 10 March 2016
  • 5 replies
  • 2 views

Badge +3

Here is what I am trying to do. On a form, I want to create a hyperlink to open an email directed to a person whose name/email is a person/group field in the list.


The problem I am running into, is how to use an item property in a hyperlink, which appears to need to be created using the label field. When you create a hyperlink, you lose access to inserting an item property field.

Thanks,


5 replies

Badge +11

Hi Nick,

have you tried to use a "Rich Text" field? In the configuration of this control you can insert a "Link" and use the item properties as well.

Capture.JPG

Regards

Philipp

Badge +3

Philipp,

Using the rich text does allow me to insert a referenced item, but just within the body. After I click on Link to insert a link, this opens in a dialog which prevents me from calling on an item property.

Also, using O365:

179923_pastedImage_0.png

Badge +4

You could use javascript and build your mailto by passing the value from the input field.  Then add a button to your form that calls your JS.

Badge +3

Thank you for the suggestions. I have found a solution without JS.

If you create  label on a form, you can insert an item reference, but not if you create a hyperlink in the label, as mentioned above.

So, these are the steps I followed to get this to work:

  1. Insert Label on form
  2. In the body of the label, insert the item
    reference to the person/group field(email)
  3. Save the label
  4. The “Text” shown on the label displays the
    syntax I need
    1. E.g. for a Person/Group field called “UserName”,
      the syntax is “{ItemProperty:csfuEmail}”
    2. This text “csfu” has nothing to do with my
      column, and I have no idea what generates it
  5. Taking this syntax for my UserName field email
    address, I can then go to another label (or back to the same one), and click the
    “view html” button
  6. I deleted everyone and inserted the following,
    which is a standard html code for email to:
    1. <a href="{ItemProperty:csfuEmail"
      target="_top">Send Mail</a>
  7. Save this and you form should have a link called
    “Send Email”, which opens a new email to the person in the field “UserName”.

The trick here was figuring out the correct syntax to use for the named property, which appears randomish???

Userlevel 3
Badge +8

You can do this the same way you would in infopath or adobe:

- Add a rich text field and click the insert tab at the top, then click link.

- In the address field type  or whatever email you're wanting to link to open.

- Then type the text you would like to display.

- click OK

done happy.png

Please note: the link does not show up in the form designer. You have to preview the form to see it/test it.

also, this will not work with data real time being entered into the form. I'm wondering if there's a way to set a variable with a field value and reference it somehow but haven't figured it out.

Reply