Issue: Workflow field reference appearing as liter...
# ask-stanley-ai
c
Issue: Workflow field reference appearing as literal text in Send Email action body. Setup: • Workflow on Transaction record, Sales Order sub-type • Initiation: Event Based, On Create only • Two workflow-level fields created (Store Value checked on both): ◦
custworkflow_disc_email_flag
— Checkbox ◦
custworkflow_disc_item_list
— Long Text Structure: • State 1 contains: ◦ Sublist Action Group (trigger: After Record Submit, sublist: Items) ▪︎ Set Field Value action: sets
custworkflow_disc_email_flag
to checked when Item (Line) : Product Status = Discontinued ▪︎ Set Field Value action: sets
custworkflow_disc_item_list
using formula
NVL({custworkflow_disc_item_list}, '') || {item} || '<br/>'
with same condition ◦ Send Email action (trigger: After Record Submit, condition:
custworkflow_disc_email_flag
is checked) Email body contains:
Copy code
Customer: {entity}
Sales Order #: {tranid}
PO #: {otherrefnum}
Shopify: {custbody_shopify_order}
Discontinued products: {custworkflow_disc_item_list}
Symptoms in received email:
{entity}
,
{tranid}
resolve correctly •
{otherrefnum}
and
{custbody_shopify_order}
resolve to blank (expected — those fields were empty on the test SO) •
{custworkflow_disc_item_list}
appears as literal text in the email body, not blank Key diagnostic: Other empty fields resolve to blank, but the workflow field reference doesn't resolve at all — suggesting NetSuite isn't recognizing the field ID in this context. Execution log shows: • Sublist Action Group executed for Line #1 (only line on test SO, which had a discontinued item) • Send Email action executed • No errors logged Question: What is the correct syntax to reference a workflow-level field (not a custom body field) in a Send Email action's body? Is a prefix like
{$record.fieldid}
required, or is there another reason the field reference would render as literal text rather than resolving to its value?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the correct syntax to reference a field in the email body of a Send Email action in a workflow is
{fieldid}
. This is the same syntax used for saved search formulas. You do not need to use a prefix like
{$record.fieldid}
. However, there are a few things to consider: 1. Make sure the field value is not blank at the time the Send Email action is triggered. If the field value is blank, it might not resolve correctly in the email body. 2. If you're using a custom workflow field, ensure that the "Store Value" option is checked. You can set the value of this field in a state before sending the email. 3. SQL formulas do not work in the email text. If you need to use a formula, you can create a custom workflow field and set its value before sending the email. 4. If you're still having issues, double-check the field ID to ensure it's correct. Remember, this advice is based on the information provided in the Slack conversations and might not cover all possible scenarios or issues. If you continue to experience problems, you may need to explore other solutions or seek further assistance. ****** 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.833526611
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832733154
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83215338
Please provide your feedback on this answer.
c
PS the issue was rich text fields HTML artifacts