Using the Email to Salesforce function. I've had a request to automate a follow up task when an email is sent. When the email is sent, a task is created in salesforce and it has the appropriate contact associated with it. The follow up task that the flow created does not have the contact populated in the Name field even though I have set the Name ID of the to be created task to have the Name ID of the Triggering task. I also tried to use a Get Record step to get the Name ID in the triggering task and use that variable in creating the new task. However, this still failed.
Further Details:
This is a record triggered flow that starts when a task is created with the subject starting with "email".
I have a create record step that assigns the Due Date and Subject to variables I create and the Name ID to the Name ID of the triggering Task.
After sending an email through Outlook with the Email to Salesforce email in the bcc line, a Task is created and associated with the Contact associated with the email address.
The flow creates the follow up task with the appropriate Due Date and Subject but the Name field is not populated.
What am I missing?
You've built this correctly. The problem is a timing issue with how Email to Salesforce populates that field, not a mistake in your Flow.
The Name field on a Task is the WhoId, and here's the catch: when Email to Salesforce creates the task, it does not set the WhoId at the exact moment the task record is inserted. It creates the task first, and then a separate process matches the email address to a Contact or Lead and stamps the WhoId onto the task a moment later. Your record-triggered Flow fires on task creation, which is that first instant, before the WhoId has been populated. So when your Flow reads the triggering task's Name ID, it's genuinely empty at that point, and it copies an empty value onto your follow-up task. That's why both approaches failed, including the Get Records attempt, the field simply isn't filled yet when your Flow runs.
The most reliable fix is to change your Flow's trigger timing. Instead of firing when the record is created, set the flow to run when a record is created or updated, and set the entry condition to require that the Name ID (WhoId) is not null. That way the Flow waits until the Email to Salesforce process has actually stamped the contact onto the task, and only then fires with the WhoId available to copy. You'll want a condition to make sure you don't create duplicate follow-up tasks (for example, only fire when WhoId becomes populated and some custom flag isn't already set), but this is the pattern that matches how Email to Salesforce actually behaves.
An alternative is to add a small delay using a scheduled path. Keep the create trigger, but instead of creating the follow-up task immediately, use a scheduled path set to run a few minutes after creation. By the time the scheduled path executes, the WhoId has been populated, and a Get Records at that point will retrieve the real contact. This works but a few minutes of delay on the follow-up task creation is the tradeoff.