I have a scheduled workflow on a custom record, wh...
# ask-stanley-ai
s
I have a scheduled workflow on a custom record, where if it meets the criteria on a saved search, it will send an email from a specific email template. When using ${customer.companyname}, nothing shows in the email. The customer is a field on the custom record. How do I get the customer's name to show on this email template?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like you're trying to reference a field from a related record (the customer) in your email template. The issue is that the email template only has access to the fields on the record that the workflow is running on (the custom record). To get around this, you can create a formula field on your custom record that pulls in the company name from the customer record. You can then reference this formula field in your email template. Here's how you can do it: 1. Go to the custom record definition and create a new field. Set the type to "Formula (Text)". 2. In the formula field, use a formula like this:
{customer.companyname}
. This will pull in the company name from the customer record linked to your custom record. 3. Save the new field. 4. In your email template, you can now reference this new field like this:
${record.custrecord_your_new_field}
. Replace
custrecord_your_new_field
with the actual ID of the new field you created. Remember to replace
customer
and
companyname
with the actual field IDs in your account, and replace
custrecord_your_new_field
with the ID of the new field you created. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.867595673
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.857195914
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851142168
Please provide your feedback on this answer.
a
In the Email Template try using ${record.your_customfield_id} instead, where the field ID is of the one on the custom record that references the Customer record. If you want it to use the companyname instead of the entityid on that Customer record, then use ${your_customfield_id.companyname} Let me know if that works. I'm not sure what objects a workflow Send Email action gives to the Email Template. It might not even be sending a "customer" object to get customer.companyname from, if the workflow is running on the custom record rather than the customer record. You might be able to test this in the Email Template by adding a part in the source code that says
Copy code
Has Customer object: ${customer?has_content}
And see if when you send an email from the workflow, whether it says Yes or No after "Has Customer object".
s
Thanks so much! After testing with the ?has_content, I just threw enough stuff at it and was able to get it by doing ${customrecord.custrecord_customer.companyname} - looks like just ${record} wasn't enough
1