3

I know we can fetch Active Version and latest version details using Tooling API from FlowDefinition, however is there a way we can fetch sObject details?

'/services/data/v43.0/tooling/query?q=Select+Id,ActiveVersion.VersionNumber,LatestVersion.VersionNumber,DeveloperName+From+FlowDefinition+ORDER+BY+DeveloperName'
1
  • 1
    Hi @sfdcfox, I hope you can help me here. How do we get sObject name in the query?
    – Ajay
    Commented Aug 19, 2019 at 21:25

1 Answer 1

0

You can only get sObject details if you add an Id = 'flowId' to your query in the Tooling API or call the /tooling/flow/flowId endpoint.

The info is in the Metadata of the flow which you can only pull when you get one record. You'd have to query all process builders (Process Type = 'Workflow') and then get the info for each specific process builder returned to get the sObject label with /tooling/flow/flowId or, if you have the Ids, query with a Id = flowId for each flow (or combine into one composite request).

I simplified what comes back in the "Metadata" portion of the response to only include the processMeatadataValues you'd be interested in. It's under the "ObjectType" name and contains the label in stringValue

 "Metadata" : {
"processMetadataValues" : [ {
      "name" : "ObjectType",
      "value" : {
        "booleanValue" : null,
        "dateTimeValue" : null,
        "dateValue" : null,
        "elementReference" : null,
        "numberValue" : null,
        "stringValue" : "Account"
      }
    }],
}

enter image description here

You must log in to answer this question.

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