Add Another Resolver Method
Now that we’ve built the foundation of resolving and disambiguating Salesforce accounts, we will see the power and time savings when adding new ways to lookup Salesforce accounts. We will simply add another action for looking up accounts a different way, and let the Entity Resolver do the work for us. Let’s build an action where we look up accounts based on the owner name.
-
Once in Agent Studio, navigate to “HTTP Actions”
-
On the top right, click the “CREATE” button
-
Since we are using a shared Salesforce Sandbox instance, the connector has already been set up for you. Choose “Inherit from existing connector” and select “salesforce_developer_labs”.
-
After choosing this connector, you can see the Base URL is already populated for you as “https://moveworks--devlabs.sandbox.my.salesforce.com”. We are going to be using the “query” API in Salesforce in order to retrieve the account by owner name. The path for this is /services/data/v59.0/query
-
Now that we’ve set up the Auth, move over to the “Header” section and add the following key Content-Type and value application/json. This tells the Salesforce API it will be transacting in JSON.
-
Now navigate to “Query Params”. This is where we will pass the SOQL query to the API. Add a parameter with a key of q and the value will be
SELECT Id, BillingAddress, Description, Industry, Name, Owner.Name FROM Account WHERE Owner.Name LIKE '{{full_name}}'
Note the “name” field in double curly brackets - this is telling Moveworks it needs to collect the owner’s full name within the conversation as a required input in order to proceed with this action. It is dynamically populated and collected within the conversation.

-
Now navigate to “Input Args” - you should see that the full_name variable has been detected in the API call and it is of type “string” which is correct. You should also provide a “Example Value” so that we can finally test our API by passing an example account name to it and validate the schema is correct. You can use your own full name, or take a look at other accounts in Salesforce to see who the owner is and try that as your example value. Make sure you provide a description as well. Tick the “Required” checkbox and click “Save”.
-
Click the “TEST” button. If your API call is successful you should see the output in the Console section below. NOTE: You may need to click the bar at the bottom of the page and drag it up to view more of the Console.
-
Now we must name our HTTP Action. At the top, select the title bar to name your HTTP Action (see the note below before doing so). Your description can be anything that describes the Action such as “Lookup a Salesforce Account by the Owner Name”
IMPORTANT: Ensure you name the action in this format ”firstname_lastname_lookup_account_by_owner”. This will ensure you know you are using YOUR action since there are many people at once doing the same exercise in this environment.On the top right, click the dropdown and choose “Validate”. This will ensure everything is correct before publishing. If everything checks out, choose “Publish”.
You should see the following upon success.
-
Now that we have our Lookup Account By Owner Name action setup, all we have to do is reference it in our data type. Navigate back to Data Types and find the one you created for your account object.
-
Tab over to “Resolver Strategy” and scroll all the way to the bottom. Click “Add Method”.
-
In this case, we are going to leverage the action we just created to look up accounts that are owned by ourselves. Name the method “lookup_account_owned_by_me” or something similar. Choose “Dynamic” as the Method Type, and select the action you just created for looking up accounts by owner name.
-
Since we are looking up accounts owned by the user who triggered this plugin - we don’t need any input. This is interesting because Moveworks already knows the profile of the user such as their full name, email, role, etc. We can simply leverage what we already know about the user through meta_info.user. You can read more about this here. So we won’t be taking any input args. For the placeholder, use meta_info.user.full_name. This will dynamically extract the user’s full name and pass it directly to the action.
-
Under “Output Mapping”, we will again reference .records since that is where the payload of the array is in the Salesforce schema. Under “Output Cardinality” use “Interpret output as a list of candidate values” since we should expect one or more accounts to be returned.
-
On the top right, click the dropdown and choose “Validate”. This will ensure everything is correct before publishing. If everything checks out, choose “Publish”.
Updated about 7 hours ago