Help

"Message" could not be converted to a string.

Topic Labels: Automations Formulas
2039 5
cancel
Showing results for 
Search instead for 
Did you mean: 
Lisa_Wetherby
5 - Automation Enthusiast
5 - Automation Enthusiast

I am trying to insert a formula field for a "friendly name" into an automated email.

The formula just looks to see if a person has a nickname and then either uses the first name or the nickname.

IF({Nickname},{Nickname},
IF({First Name},{First Name}))
I keep getting this error message:
""Message" could not be converted to a string."
What the heck does that mean?
Thanks,
~Lisa
 
 
5 Replies 5

Hey @Lisa_Wetherby

When inserting field value tokens into Slack or email automations, this error is thrown when the field is returning blank.

For additional context, when the automation is triggered, Airtable takes a sort of "snapshot" of the record that is the subject of the automation. It's properties and its contained data are then available to you to use in future automation steps.

Without getting too deep into it, when Airtable queries the record to store the information to use in the automation, it will only save fields that contain information. If a field is blank, it is functionally left out of that "snapshot" I mentioned.

When the automation is run, Airtable takes all the field tokens you inserted into your automation actions and turns them into strings. That backend operation assumes that the information it's converting exists to begin with.
When we feed it a field reference and that field returns null, it throws the error.

To fix this, you'll want to make sure that your formula field (or any field used in the automation) returns something and not null which is what your formula currently does.

Personally, I would recommend that you leave your formula untouched.
Instead, in your automation, create a conditional automation filter that will only allow the automation or automation action group to run if the formula field is not empty.
This is strategic not just because you don't want automated messages to fire off with incorrect formatting, but also because it indicates an issue with your data hygiene if your records are missing critical information such as name information.

Lisa_Wetherby
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey @Ben! Thanks for the response.

That would make sense to me if the field was empty - but it's not. There is clearly data in the field - I can see it in the table. What am I missing?

Is the automation already turned on, being triggered, and then throwing the error?
Or are you testing the automation and it's failing?

If the automation is already on and being triggered, then that's a whole different story.
If you're seeing the error when testing the automation, then retest your automation trigger to refresh the "snapshot" that Airtable has of the record.

Let me know what you find after testing that out and we'll go from there!

Lisa_Wetherby
5 - Automation Enthusiast
5 - Automation Enthusiast

It's turned on, being triggered and then throwing the error. I just tested it with a different record and it worked - but I think the problem is that it's pulling data from the wrong table.  I can't see how to specify which table to pull from.

 

Sean_Lake1
8 - Airtable Astronomer
8 - Airtable Astronomer

I too just recently received this error and the field has a proper email in the text, so conversion makes no sense.

"To" could not be converted to a string.

Sean_Lake1_0-1697737284904.png