cancel
Showing results for 
Search instead for 
Did you mean: 

Generate dynamic HTML file in snaplogic

shashish_jha
New Contributor II

Hi All,
Have a question:
I have a Script file that generates a dynamic html file.
And this dynamic html file generated is fed into EMAIL SENDER snap.
Problem: I want to place my script file inside snaplogic directly.
Unable to achieve this.
I am pasting my script here:
script.txt (10.4 KB)

If any one can help me how to place the script code into snaplogic.
Tried using script snap but was unable to make it work.
Any help would be much appreciated.

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

@shashish.jha - welcome to Community!

It looks like you want to generate dynamic HTML using the JSON document input wihtin a pipeline, correct? One out-of-the-box solution is to use an XML Generator snap. This does make the syntax a little more strict since XML requires open and close tags, but it will work. I’ve attached an example.
Dynamic HTML_2023_02_27.slp (7.7 KB)

To try it out, just upload the pipeline, create a triggered task, and call it from a browser.

If you want something a bit easier to use that supports CSS and HTML Script within the HTML body, you can contact your CSM to request the HTML Generator custom snap.

Hope this helps!

View solution in original post

5 REPLIES 5

darshthakkar
Valued Contributor

Thanks for the reply.
I went through this thread.
It tells us about what to do once you have the html file.
Like place it in the mapper and send it out to doc to binary snap.
What i am looking for is before getting the html file.
Have tried to explain here below:
I have a script that generates a html file.
This script right now is working on a website(client side) and gives us the html file.
I want this script embedded into my snap logic pipeline and generate an html file.
Basically i don’t want to generate the html file through website but through snap.

koryknick
Employee
Employee

@shashish.jha - welcome to Community!

It looks like you want to generate dynamic HTML using the JSON document input wihtin a pipeline, correct? One out-of-the-box solution is to use an XML Generator snap. This does make the syntax a little more strict since XML requires open and close tags, but it will work. I’ve attached an example.
Dynamic HTML_2023_02_27.slp (7.7 KB)

To try it out, just upload the pipeline, create a triggered task, and call it from a browser.

If you want something a bit easier to use that supports CSS and HTML Script within the HTML body, you can contact your CSM to request the HTML Generator custom snap.

Hope this helps!