CloudPages Preview shows error with certain AMPScript or SSJS functions
Trailblazer Community

CloudPages Preview shows error with certain AMPScript or SSJS functions

Marketing Cloud Pages/Sites

Last updated 2021-02-16 ·Reference W-8853790 ·Reported By 5 users

Fixed in version Marketing Cloud Release January 2021 Patch 2

Summary
CloudPages Page Preview displays an error when an AMPScript or Server-Side Javascript (SSJS) function that inserts, updates, or reads data from a data extension is included in the body of the page.

Repro
1. Go to CloudPages
2. Create a Landing Page or Microsite Page
3. Include an AMPScript or SSJS function that inserts, updates, or reads data from a data extension (ex. UpdateData()).
4. Click Save/Publish

The Preview will display an error that includes an error similar to:
UpdateData Function is not valid in content. This function is only allowed in a non batch context.

Workaround
Publish the page to test functionality. This error only affects viewing the page while in Preview. The page can still be published, and the function will execute as expected if properly constructed.

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.