Use case: Through automation studio, a script activity is use to call and reference a content area through the "ContentAreaByName" function. That content area contains AMPscript that performs specific functions. This idea come from and was detailed through this thread:
The process works great, but with classic content nearing retirement I would love to be replicate this with Content Builder. The issue is that whenever I build a Content Block instead of Content Area, and call either the "ContentBlockByName" or "ContentBlockById" functions the script errors every time. The AMPscript is validated and works as a Content Area, but will not work as a Content Block. The function I use is as below:
<script runat="server"> Platform.Load("Core","1.1.3"); var stream = ContentBlockById("[ContentBlockId]"); Write(TreatAsContent(stream)); </script>
Has anybody been able to achieve this?