Search code examples
ssjsampscript

Add delay using ampscript or SSJS in cloud pages


Hi I'm trying to add delay withing cloud page using Ampscript / SSJS, is it even possible?

What im trying to accomplish is, Create a record in salescloud from the cloud page, wait for 5 seconds, then query the same record it will have a status updated and based on the status display different sections in my cloud page.


Solution

  • There is no server-side function in ampscript or SSJS to simulate a delay.

    To accomplish this, I would recommend having 2 cloud pages, the 1st page would preform the Create record functionality and then redirect or call the 2nd landing page after 5 seconds. The 5 second wait would need to occur client-side by either using javascript or meta tag.