FlowElementTestCoverage

Represents a flow element that was executed by a given Apex test method.

Version 

Introduced in API version 44.0.

Supported SOAP API Calls 

delete(), describeSObjects(), query(), retrieve(), update()

Supported REST API Methods 

DELETE, GET, HEAD, PATCH, Query

Fields 

ElementName 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort, Update

  • Description: The unique name of the flow element that’s executed by the test method.

ElementType 

  • Type: string
  • Required: No
  • Properties: Filter, Group, Nillable, Sort, Update
  • Introduced: API version 67.0

FlowTestCoverageId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: The ID of the parent FlowTestCoverage record.

  • Relationship name: FlowTestCoverage

  • Relationship type: masterdetail

  • Refers to: FlowTestCoverage

FlowTestId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Nillable, Sort, Update

  • Introduced: API version 67.0

  • Relationship name: FlowTest

  • Relationship type: relationship

  • Refers to: FlowTest

FlowVersionId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Sort, Update

  • Description: The ID of the flow version that’s executed by the test method.

  • Relationship name: FlowVersion

  • Relationship type: relationship

  • Refers to: InteractionDefinitionVersion

Path 

  • Type: string
  • Required: No
  • Properties: Filter, Group, Nillable, Sort, Update
  • Introduced: API version 67.0

Position 

  • Type: int
  • Required: No
  • Properties: Filter, Group, Nillable, Sort, Update
  • Introduced: API version 67.0

Usage 

FlowElementTestCoverage records are deleted when changes are saved to the associated flow version.

A flow version corresponds to a process built in Process Builder or a flow built in Flow Builder. When you create a process, Salesforce names each element for you. To understand which criteria node or action corresponds with an element name, see Troubleshoot Processes with Apex Debug Logs.

Tip

Sample Queries 

Get the executed elements that were executed by any test

1SELECT Id, Elementname, FlowTestCoverageId 
2FROM FlowElementTestCoverage 
3WHERE FlowVersionId='301RM0000004GiK'

Get the number of elements that were executed by any test

1SELECT count_distinct(ElementName) 
2FROM FlowElementTestCoverage 
3WHERE FlowVersionId='301RM0000004GiK'

Get the names of the elements that were executed by any test

1SELECT ElementName, count(Id) 
2FROM FlowElementTestCoverage 
3WHERE FlowVersionId='301RM0000004GiK' 
4GROUP BY ElementName

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!