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.
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.
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!