Skip to main content
Solved

Datatable in Email


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 MIKE 5870

Aaron.Gleason wrote:

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

View original
Did this topic help answer your question?

Marc Mueller
Pathfinder Advocate | Tier 6
Forum|alt.badge.img+15
  • Pathfinder Advocate | Tier 6
  • 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+10

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
  • 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+10

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
  • 3 replies
  • Answer
  • March 31, 2025
Aaron.Gleason wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings