I created a 2GP managed package that includes a protected hierarchy custom setting (let's say it is called namespaced__Protected_Custom_Setting__c) for some configuration that needs to be hidden from the end user. I packaged a permission set that has this custom setting enabled.

However when I install the package in a developer org and try to use a flow that has that custom setting I am receiving unhandled fault. When I check the logs I can see the below error.

FLOW_ELEMENT_ERROR  common.exception.ApiQueryException: sObject type 'namespaced__Protected_Custom_Setting__c' is not supported. 
If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

I know protected custom settings are working fine in a 1GP managed package but I cannot see if there is a limitation regarding to this in 2GP managed package. And I cannot give OLS/FLS as this is hierarchy custom setting. Also setting the flow in System Mode does not resolve the problem.

How can I have protected custom setting in flow in a 2GP managed package? Is this a known limitation? I can do a workaround and use invocable Apex since it looks like Apex can retrieve and/or modify the custom setting but I would prefer to keep it in the flow if possible.

  • is your flow included in the managed package? Or you created it in the org, outside of the package? Commented Apr 9 at 14:19
  • It is included in the managed package.
    – tugce
    Commented Apr 10 at 10:12

1 Answer 1


For this one I had to use Apex workaround where I queried and did the logic in the invocable method while using flow as screen element to show message to the end user.

You must log in to answer this question.

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