Salesforce Flow – Update Records Element Question

lookuplookup-fieldtrailheadvisual-workflow

I think I have a pretty easy question for more advanced Flow users.

I was working through the Data and Actions in Flows module on Trailhead and on the 2nd section of the module called Data and Actions in Flows, located at https://trailhead.salesforce.com/content/learn/modules/data-and-actions-in-flows/combine-variables-data-elements – I worked thru the challenge with no problem but I am just curious as to why in the Update Records element they have you update the Possible Matching Account field by using the Account ID field from the record variable instead of the Account Name field?

Out of curiosity, I tried the Flow using both fields and it works the same, so if there is a match on the Lead-Company field, it will populate the Account's name in the Possible Matching Account field but I am just curious as to how it works with the Account ID field. Is it because the Possible Matching Account field is a Lookup and it just automatically returns the matching Account Name instead of the Account ID?

As a test, I later added a 'second' Possible Matching Account field (just a plain text field, not a Lookup) called Possible Matching Account text and set it to return the Account ID from the record variable as I thought that it would put the actual Account ID (0011R00002NeJ81QAF in this case) into that text field but it returned nothing at all but it did still populate the Possible Matching Account field correctly.

I don't understand why the actual Account ID didn't populate into the 'second' Possible Matching Account text field.

Hopefully this makes sense.

Here are some screenshots just for giggles.

I'm trying to become a Flow expert and so I like to understand everything as much as I can. It's probably an easy explanation but right now, it's just confusing me.

screenshot1

screenshot2

Best Answer

That challenge requires you to create the "Possible Matching Account" field on the lead that is a lookup to an account. Being a lookup means that the field only accepts ids for the object it looks up to (an account Id in this case).

If the challenge had you create a text field then it would make sense to assign the Name field instead.

So, answering your question:

Is it because the Possible Matching Account field is a Lookup and it just automatically returns the matching Account Name instead of the Account ID?

Yes. Lookups on page layouts show the "name field" of the record in the UI.

Name fields are fields that are used to identify the name of an object. Usually it is the Name field for custom objects, but for some standard objects it might be different, such as for the Case object, where the name field is the CaseNumber and for some objects that identify people, where the name fields are FirstName and LastName. You can retrieve the name fields of an object through the UI API.

Related Topic