Table or Records to HTML format

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

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

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

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 :frowning:

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:

(here is that simple example flow)
Test Html mail2.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

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

Hope this helps!

B R
Ivan

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

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)

B R
Ivan

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 :slight_smile: for newbies like me.
Thank you!

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.

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:

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

Hope this helps.

1 Like

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.


Test Html mail3.flow (33.1 KB)

Hope this helps!

B R
Ivan

1 Like

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 :slight_smile:

Regards,
Faye

1 Like