I was trying to follow along with the write up here: https://ampscript.xyz/how-tos/how-to-retrieve-all-shared-data-extensions-using-ssjs/

In doing so, I know the script works, but I notice the write function is what's outputting everything. I'm pretty new to SFMC, so I'm wondering, where are you able to see this output? I have seen a few suggestions to put that script on a landing page, but WSProxy doesn't work on Landing Pages or anything considered "sendable" based on the errors I'm getting.

Do you have any suggestions for outputting this somewhere I can see it?

Error Message: "Exception has been thrown by the target of an invocation."

Description: "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. - from mscorlib --> --- inner exception 1--- ExactTarget.OMM.FunctionExecutionException: WSProxy object is not valid in sendable content. This function is only allowed in non-sendable content. Object: Script.Util.WSProxy() Error Code: OMM_FUNC_CONTEXT_ERR - from OMMCommon "

  • A cloud page is not sendable context, and there is nothing preventing wsproxy from running there Commented Feb 8 at 6:25

1 Answer 1


If you are looking at the cloudpage preview, try publishing the page and the script should execute. For reasons unknown to me, the preview of the page I believe is handled like "sendable context" or at least gives that error message and won't run the code. Published page is different.

if you publish a page, understand you are giving access to your script's capabilities to anyone with the URL, and you are potentially exposing data. Once it comes to Personally identifiable data you should be very, very careful and think about authentication.

  • Yes! Now I remember writing about this myself 😂 So ridiculous: linkedin.com/posts/… Commented Feb 8 at 9:27
  • ha! yeah that was my suspicion too, they reused the email render engine. move on... Commented Feb 8 at 11:31

You must log in to answer this question.

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