Using Query Result as Email Body

Hello! I've created a workflow that is supposed to summarize our Domo credits used in the previous month by user, then send each user an individualized email reporting what they've used. The query seems to run fine, but when I Send Email To Person the body of the email shows all null values for the dynamic fields. I think I'm defining the objects incorrectly, but I'm not sure. Has anyone resolved this for themselves?
Answers
-
Hi @EmilyRho_s These might help you. Please see the following and review it.
1. Check Field Names (Case-Sensitive)
Make sure the dynamic fields you're referencing in the email (e.g.,
{{CreditUsed}}
,{{UserName}}
) exactly match the column headers in your dataset. Domo is case-sensitive, sousername
andUserName
are different.2. Confirm Input to the "Send Email to Person" Action
Double-check that each row in your dataset (or dataset used in a DataFlow or Magic ETL) has the correct data populated before the email step. The “Send Email to Person” step acts per row — if fields are null there, it's likely they weren't populated upstream.
3. Output Object from Previous Action
Look at what the previous action is sending into the “Send Email” step. If you're using a dataset in a Magic ETL or Workflow, verify that:
- The object passed to the email action includes the expected fields.
- You're using the correct syntax in the email body like
{{field_name}}
.
4. Testing Tip: Use a "Write to Dataset" Step
Before the email, insert a "Write to Dataset" step to log the fields you're expecting to send. That way, you can see exactly what each row looks like just before the email is sent.
5. Sample Email Body Syntax
Your email body should look like this:
CopyEditHello {{UserName}},You used {{CreditUsed}} Domo credits in the past month.Best,The Team
Make sure
UserName
andCreditUsed
are exactly the field names passed to this step.Let me know if this helps you and get the desired output.
0 -
Thanks for the suggestions, vtiwari!
The Workflow looks pretty different now, but here are the biggest fixes that helped me:
- Moved the loop. The conditional logic needed to be before Filter By User (getObjectFromList) to correctly get one object from the list of objects.
- Added Child Properties to individualUsage that matched lastMonth. The SQL statement pulls a list of objects (a bunch of rows; lastMonth), then the filter pulls one object (one row; individualUsage) at a time. I added Child Properties to individualUsage that exactly matched the names of the Child Properties of lastMonth. This allowed the data to properly map to individualUsage and show up in the bodies of each email.
- (Optional) Removed Create Index. I created a variable called Index and set the initial value to 0 so that the Create Index tile could be removed.
0
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 664 Datasets
- 119 SQL DataFlows
- 2.3K Magic ETL
- 823 Beast Mode
- Visualize
- 2.6K Charting
- 86 App Studio
- 46 Variables
- Automate
- 194 Apps
- 484 APIs & Domo Developer
- 89 Workflows
- 24 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 119 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive