How to Reference the Current Record ID in the New Agentforce Builder (Video 1:57)

If you have created an employee agent in the new Agentforce Builder, you may notice that, unlike the legacy builder, the agent does not automatically recognize the currently opened record.

So, for example, if you are on an Account record and ask the agent to summarize this account, it may not be able to identify which record you are referring to.

In this video, I show you how to fix this by updating the agent’s instructions so it can reference the current record ID of the record that is currently open in Salesforce.

This is useful when you want your agent to work in the context of the record a user is viewing, instead of asking the user to manually specify which record they mean.

Steps to Fix It

  1. Open your agent in Agentforce Studio and create a new version.

  2. Open the topic that handles record questions (for example, General CRM) and add this line to its instructions:

The current record ID is @currentRecordId
  1. Save, then commit and activate the new version.

  2. Open any Account record and ask the agent to summarize “this account”. It now works with the record you have open.