# Table or Records to HTML format

**URL:** <https://forum.novacura.com/t/table-or-records-to-html-format/735>\
**Category:** Flow Classic\
**Created:** [July 29, 2024, 2:48am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735 "2024-07-29T02:48:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![FAF1](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@FAF1](https://forum.novacura.com/u/FAF1)\
**Post date:** [July 29, 2024, 2:48am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/1 "2024-07-29T02:48:50Z")

</div>

Hello! I am really in need of your help please. Couldn’t find any related topics so posting one but do direct me if ever this has been discussed here before.

I have a grid table in my form and i wanted to show this grid table in a summary page.

is there a way to convert a grid table to text in an html format using a script step?

Appreciate your help please

---

<div class="post-metadata">

**Author:** ![Shyamraj](https://avatars.discourse-cdn.com/v4/letter/s/7C9FD7/32.png) [@Shyamraj](https://forum.novacura.com/u/Shyamraj)\
**Post date:** [July 29, 2024, 10:37am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/2 "2024-07-29T10:37:51Z")

</div>

Hi FAF1,

Is it that you wanted to show all the data’s that are present in the grid into the summary page using html script?

If so then you can refer to the **iterator tag** in the html to fetch all the data’s from the grid into the page you wanted to show using html script.

Regards,  
Shyamraj Choudhury

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [July 29, 2024, 2:05pm UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/3 "2024-07-29T14:05:24Z")

</div>

Hi,

when you say “show in a summary page” do you mean show data from a table (that you first show in datagrid) in a Porta2 page?  
Or do you want to generate a document (HTML to PDF) and then show that?

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![FAF1](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@FAF1](https://forum.novacura.com/u/FAF1)\
**Post date:** [August 1, 2024, 7:55am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/4 "2024-08-01T07:55:18Z")

</div>

Hello @Shyamraj and @ivstde,

I have this grid table from my page and want if possible to display the data entered here in my email with same table format. And is it also possible to compute the USD rate of the entered value in the Remarks?

Example:  
123,000 CLP (Chilean peso) is 130.42 USD (this value will be place in the Remarks field)  
I have an SQL getting the USD rate but I have to refer to the currency that is stated in the Currency field.  
I hope I am clear and get a solution from this dilemma that I have been working on for the past week ☹

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/057aa1d139d1024f34323402c273b3e53a68b316.png)

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [August 1, 2024, 9:32am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/5 "2024-08-01T09:32:51Z")

</div>

Hi,

you can send table data in mail body as html content but you do have to build it up manually (no functionality to just attach a table variable).

So you need to use flow script to build something like this:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/42a83142bba0d53b11f0be9278f401d37e01caa3.png)

(here is that simple example flow)  
[Test Html mail2.flow](https://forum.novacura.com/uploads/short-url/sr8UMhvcnLQSAIFlZCkbcIYUksr.flow) (18.6 KB)

Then add a custom button to your table portlet and you can send mails from there.  
This is what comes in the mail body:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/2a5696f1687ca99a3d88daac0b23637cea5c285a.png)

Now the data you want to include in the HTML table you can come from a select or can come from what is currently in the table portlet if you create an Input table variable “InputTable” in the start step of the flow behind the button.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/2d3e76390ee0e5823e237ebfca97fb6702bc1fcf.png)

Hope this helps!

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![FAF1](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@FAF1](https://forum.novacura.com/u/FAF1)\
**Post date:** [August 1, 2024, 9:58am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/6 "2024-08-01T09:58:50Z")

</div>

Hi Ivan!  
This is super super big help! Thank you so so much! Another question, my currency rate is from an SQL Query where I pass the Currency code. How do I handle that part?  
Thank you once again my guru!  
Regards,  
Faye

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [August 1, 2024, 10:07am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/7 "2024-08-01T10:07:18Z")

</div>

Hi,

in the example there is also a separate CurrencyRatesTbl (like you would fetch from SQL)

So this part uses the appropriate rate and multiplies with it (matching by currency codes in both tables)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/aa5b0d90157af1f335e5796e2e387160c3bb6684.png)

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![FAF1](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@FAF1](https://forum.novacura.com/u/FAF1)\
**Post date:** [August 1, 2024, 10:19am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/8 "2024-08-01T10:19:23Z")

</div>

Thank you Ivan I just realize that now. This is such a big help especially for flow which doesn’t have much guide on the internet 🙂 for newbies like me.  
Thank you!

---

<div class="post-metadata">

**Author:** ![FAF1](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@FAF1](https://forum.novacura.com/u/FAF1)\
**Post date:** [August 2, 2024, 6:40am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/9 "2024-08-02T06:40:06Z")

</div>

Hi @ivstde ,

Sorry me again. I would totally understand if you won’t reply but I just want to give it a try again.  
I have this scenario now below base on your example. My big problem is calling my SQL passing the value from the grid table and the output back to the grid? hope i make sense.  
And again thank you so much for your big help.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/08693e2427c9c4f6d3b4fdc8d7ae9095cdab22c0.png)

---

<div class="post-metadata">

**Author:** ![daniel](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/daniel/32/708_2.png) [@daniel](https://forum.novacura.com/u/daniel)\
**Post date:** [August 2, 2024, 10:41am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/10 "2024-08-02T10:41:14Z")

</div>

I’m assuming that you are looping through each record to query the rate to then use that to get the USD value. If so, after getRate(2) you need to have a _script_ step with:

```auto
let usdTbl = tblBidInfoGrid with [UnevalPriceUSD: UnevaluatedPrice * getRate(2)] where Currency = :selCurrencyCode;
return usdTbl;

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [August 5, 2024, 8:41am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/11 "2024-08-05T08:41:10Z")

</div>

Hi,

as Daniel said you can loop through all the rows in the DataTbl and then do a SQL select per row.

But you can also go with just getting all the rates for USD and then using First() like in the example.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/580afd59af41ab04f5f2b26c650c15c503c302ee.png)  
[Test Html mail3.flow](https://forum.novacura.com/uploads/short-url/qLPudzeeu1nvzBwoM0KIuEPobkd.flow) (33.1 KB)

Hope this helps!

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![FAF1](https://avatars.discourse-cdn.com/v4/letter/f/7C9FD7/32.png) [@FAF1](https://forum.novacura.com/u/FAF1)\
**Post date:** [August 5, 2024, 10:45am UTC](https://forum.novacura.com/t/table-or-records-to-html-format/735/12 "2024-08-05T10:45:36Z")

</div>

hi @ivstde / @daniel

This works perfectly!  
You guys are the best!  
I hope you won’t get tired helping out newbies like me!  
Really really appreciate it 🙂

Regards,  
Faye
