The email()
function returns the email address of a person.
email(person)
email(personProperty.first())
person.email()
personProperty.first().email()
Code language: JavaScript (javascript)
If used on a built-in Created By or Last Edited By property, you can use the function directly like prop("Created By").email()
. These property types contain a single Person value.
By contrast, Person properties contain a list of Person objects. Therefore, you’ll need to use an accessor function like first, last, or at to select a specific element from the list, then call email()
on that element:
prop("Assignee").first().email() /* Output: "[email protected]" */
Code language: JavaScript (javascript)
You can also utilise map to return the email address for each person added to the Person property.
prop("Assignees").map(current.email()) /* Output: ["info@collegeinfogeek.com", "ben@collegeinfogeek.com" */
Code language: PHP (php)
Example Formulas
email(prop("Created By"))
/* Output: "[email protected]" */
prop("Assignee").first().email()
/* Output: "[email protected]" */
Code language: JavaScript (javascript)
Note that the email comes back as plain text, not a link. You would need to use the link function and the mailto:
prefix to add the email address.
prop("Last Edited By")
.email()
.link("mailto:" + prop("Last Edited By").email())
/* Output: "[email protected]" (as a link) */
Code language: JavaScript (javascript)