May 03, 2023 02:04 PM
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.
May 03, 2023 02:27 PM
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.
May 03, 2023 02:33 PM
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?
May 03, 2023 02:38 PM
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!
May 03, 2023 02:47 PM
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.
Oct 19, 2023 10:43 AM
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.