Skip to main content
Cadet | Tier 2
March 30, 2025
Solved

Datatable in Email

  • March 30, 2025
  • 5 replies
  • 154 views

Hola a todos, saben como puedo agregar el resultado de un Datable , en un correo y enviarlo?

Best answer by Aaron.Gleason

You can loop through the table. Concatenate a string variable something like this:

String: Assign $sTable$ = “<table>”

Loop: Through Data Table $dtMyDataTable$; assign to $rRow$

String: Evaluate $sTable$ = "$sTable$<tr><td>$rRow[0]$</td><td>$rRow[1]$</td></tr>"

String: Evaluate $sTable$ = "$sTable$</table>"

The AA language doesn’t lend itself well to code snippets, but I hope this makes sense. It loops through the data table, adding another row for each in the data table. This example has only two columns, but you can add as many as you like.

For more on the format of tables, visit this W3 Schools page:  https://www.w3schools.com/html/html_tables.asp

5 replies

Marc Mueller
Most Valuable Pathfinder
Most Valuable Pathfinder
March 31, 2025

Hi ​@MIKE 5870,

what about “write to file” action and send as attachment?

 

Cheers

Marc

🤝Let's connect on LinkedIn: https://www.linkedin.com/in/developer-marc-mueller >>>>>>>> 📺Check out my YouTube channel - https://youtube.com/@AutomationDevelopmentEasy
Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
March 31, 2025

The other possibility, if you want the table inline with the message, is to manually convert the datatable into HTML.

<table>
<tr>
<td>Column 1</td><td>Column 2</td>
</tr>
<tr>
<td>Data 1</td><td>Data 2</td>
</tr>
</table>

 

MIKE 5870Author
Cadet | Tier 2
March 31, 2025


hi ​ ​@Aaron.Gleason ,thanks for your support,   but i need to code in other language or in a AA loop package?

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
March 31, 2025

You can loop through the table. Concatenate a string variable something like this:

String: Assign $sTable$ = “<table>”

Loop: Through Data Table $dtMyDataTable$; assign to $rRow$

String: Evaluate $sTable$ = "$sTable$<tr><td>$rRow[0]$</td><td>$rRow[1]$</td></tr>"

String: Evaluate $sTable$ = "$sTable$</table>"

The AA language doesn’t lend itself well to code snippets, but I hope this makes sense. It loops through the data table, adding another row for each in the data table. This example has only two columns, but you can add as many as you like.

For more on the format of tables, visit this W3 Schools page:  https://www.w3schools.com/html/html_tables.asp

MIKE 5870Author
Cadet | Tier 2
March 31, 2025

You can loop through the table. Concatenate a string variable something like this:

String: Assign $sTable$ = “<table>”

Loop: Through Data Table $dtMyDataTable$; assign to $rRow$

String: Evaluate $sTable$ = "$sTable$<tr><td>$rRow[0]$</td><td>$rRow[1]$</td></tr>"

String: Evaluate $sTable$ = "$sTable$</table>"

The AA language doesn’t lend itself well to code snippets, but I hope this makes sense. It loops through the data table, adding another row for each in the data table. This example has only two columns, but you can add as many as you like.

For more on the format of tables, visit this W3 Schools page:  https://www.w3schools.com/html/html_tables.asp

thanks a lot ​@Aaron.Gleason , that’s what i wanted