Skip to main content
Solved

Datatable in Email

  • March 30, 2025
  • 5 replies
  • 55 views

Forum|alt.badge.img+2

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
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • March 31, 2025

Hi ​@MIKE 5870,

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

 

Cheers

Marc


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • 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>

 


Forum|alt.badge.img+2
  • Author
  • 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
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • 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


Forum|alt.badge.img+2
  • Author
  • 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