How to query shared data extensions in salesforce marketing cloud
Querying shared data extensions has been a confusing topic for me, and I have changed my understanding of it several times. At one point, I believed shared DEs could not be queried at all, and later I found Salesforce resources stating that they actually can be queried. This article aims to bring clarity to the topic – for me, and hopefully for others who are lost as well.
Query shared data extension created in same child business unit
We have created the Send Log and placed it in the shared space. Let’s see how our query functions perform.
SSJS: WSProxy.retrieve
{"Status":"Error: Data extension does not exist: ENT.SendLog","RequestID":"52e6011d-850d-412d-8768-77ed0572ecce","Results":null,"HasMoreRows":false}
SSJS: Platform.Function.Lookup
4566378
SSJS: Platform.Function.LookupRows
4566378
SSJS: DataExtension.Init().Rows.Retrieve()
[]
AMPscript lookupRows:
4566378
SSJS: WSProxy.retrieve
- WSProxy (SOAP API) is MID-aware
- In the current BU context, the SOAP call cannot see
ENT.SendLog - This usually means one of the following:
- You are executing the script in a child BU
ENT.SendLogexists in the Enterprise BU, but:- it is not shared to this BU, or
- the SOAP context does not automatically resolve
ENT.prefixes
WSProxy does not automatically resolve shared DEs across BUs unless the DE is visible and accessible to the SOAP context of the current MID.
SSJS: Platform.Function.Lookup
- The lookup successfully returned a value
Platform.Function.Lookupuses the AMPscript execution engine- AMPscript:
- does not enforce BU boundaries the same way SOAP does
- can access shared/system DEs transparently
Platform.Function.Lookup behaves like AMPscript and can access shared/system data extensions even when WSProxy cannot see them.
SSJS: Platform.Function.LookupRows
- Same engine as
Lookup - Successfully returned rows
- Confirms that rowset lookups also work across shared DEs
Both Lookup and LookupRows in SSJS bypass SOAP-level BU visibility checks.
SSJS: DataExtension.Init().Rows.Retrieve()
- No error, but no data returned
- This API:
- runs in the Content Builder / BU-scoped context
- respects BU ownership and sharing strictly
DataExtension.Init() cannot access shared/system DEs unless they are explicitly visible in the current BU.
AMPscript: LookupRows
- Works exactly like
Platform.Function.LookupRows - Confirms AMPscript’s broader internal access
Execution layers compared
| Method | Execution Layer | BU-aware | Result |
|---|---|---|---|
| WSProxy.retrieve | SOAP API | ✅ strict | ❌ cannot see DE |
| Platform.Function.Lookup | AMPscript engine | ❌ relaxed | ✅ works |
| Platform.Function.LookupRows | AMPscript engine | ❌ relaxed | ✅ works |
| DataExtension.Init().Rows.Retrieve | Content Builder API | ✅ strict | ❌ empty |
| AMPscript LookupRows | Internal engine | ❌ relaxed | ✅ works |
Query shared data extension created in another child business unit
I have another question I want to clarify: if the Send Log was created in our BU and I want to access a shared DE that was created in a different business unit, can I still query it? I know we can find a DE’s MID using WSProxy, but currently we can’t see the shared DE in our BU. To test this quickly, I will manually create a DE in another BU, move it to the shared space, and try running the same lookups to retrieve data.
SSJS: WSProxy.retrieve
{"Status":"Error: Data extension does not exist: ENT.test_shared_de","RequestID":"ce13a7d5-6440-41cb-8c4a-c338b0b20263","Results":null,"HasMoreRows":false}
SSJS: Platform.Function.Lookup
test
SSJS: Platform.Function.LookupRows
test
SSJS: DataExtension.Init().Rows.Retrieve
[]
AMPscript:
test
The results are the same as before.
Query shared data extension created in parent business unit
Last but not least, we will create a shared data extension in the parent business unit and try to query it from a child business unit.
SSJS: WSProxy.retrieve
{"Status":"Error: Data extension does not exist: ENT.test_shared_de2","RequestID":"24f5b41a-d920-444e-83f8-2fcd8af9f86f","Results":null,"HasMoreRows":false}
SSJS: Platform.Function.Lookup
test
SSJS: Platform.Function.LookupRows
test
SSJS: DataExtension.Init().Rows.Retrieve
[]
AMPscript:
test
The results are the same as before.
Lookup rows in SSJS and AMPscript used
With ws proxy we can set the MID in the calls but even with that se
đź”’ This content is for Premium Subsribers only.
Please log in to preview content. Log in or Register
You must log in and have a Premium Subscriber account to preview the content.
When upgrading, please use the same email address as your WordPress account so we can correctly link your Premium membership.
Please allow us a little time to process and upgrade your account after the purchase. If you need faster access or encounter any issues, feel free to contact us at info@martechnotes.com or through any other available channel.
To join the Discord community, please also provide your Discord username after subscribing, or reach out to us directly for access.
You can subscribe even before creating a WordPress account — your subscription will be linked to the email address used during checkout.
Premium Subscriber
19,99 € / Year
- Free e-book with all revisions - 101 Adobe Campaign Classic (SFMC 101 in progress)
- All Premium Subscriber Benefits - Exclusive blog content, weekly insights, and Discord community access
- Lock in Your Price for a Full Year - Avoid future price increases
- Limited Seats at This Price - Lock in early before it goes up




