0

Apart from this field being required, what is the practical value for me in giving API names to flow components? For example if I create a "Get Records" component, can I reuse it using its API name in another place somehow?

What's the usefulness of it and why is the API name not auto generated?

enter image description here

2 Answers 2

2

The API name is used all the way down to the core Flow engine. At the top level, the Flow Builder, you can generally use API names in formulas to obtain values. I'm not sure if all types of API names can be used, but many can be used in interesting ways. For example, you can refer to the API name of a Choice to get the value the user selected.

Underneath this is an XML representation of the metadata, a flow-meta.xml file. This file requires an API name for every element, as that name is used to link components together (via connectors and other types of nodes). This is the actual file that is used by the Salesforce APIs to work with flows. The names need to be unique, and present, so that the nodes are all connected.

This is further built-in at the database layer, where the API name is presumably used as a composite key (Flow Version + API Name) to store the metadata for your flows. The name is required here, too.

As for "why it's not automatically populated", well, it is (or is supposed to be). Make sure you're using a supported browser. If you are, consider logging a bug report with Salesforce Technical Support.

1
  • Thanks for the answer. It does auto populate in my browser. My question about auto population was rather why does it not auto assign itself an id like a normal record and requires me to create an API name. It's not a big deal, I was just curious. Oct 8, 2020 at 9:46
2

Just to add to the great answer from @sfdxfox.

Yes, you can use this API Name:

  • In Apex:

https://help.salesforce.com/articleView?id=flow_distribute_system_apex.htm&type=5

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/flow_interview_class.htm

1
  • Perfect, this is exactly what I wanted to know, thanks! Oct 8, 2020 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .