Table attribute dynamic text for custom print layout?

I'm trying to publish a custom print layout and try to unitize the dynamic text to make outputting a map easier. soon, I found this function very useful, but I tried several time and it seems that the dynamic text doesn't get transfer over when I publish it into a webtool.

Is there a way to include this dynamic text in a custom print layout web tool?

Pls note that tutorial was written assuming ArcMap being the publishing/authoring client app (not ArcGIS Pro). So, if you want to go with this solution from ArcGIS Pro, then pls remember you can't follow these steps literally.

Also, note that this is a heavily customized solution targeting a very specific use case - not meant as a generic print service solution. Plus, for performance reasons, we usually recommend not to have any layers in your layout templates.