Output data table - cannot get values of data table

When I generate a data table and add that table into a PowerPoint slide I get this:

image

Is there a way of getting the actual table rather than ‘System.Data.DataRow’?

Hi @E.T.S ,

Let us know if possible with a Sample PPT file, the Output representation you need in the Slide.

We did have a similar conversation before, Also let us know what is different from previous conversation :

Hi @supermanPunch ,

This is the output I would like - the table fits into a PowerPoint slide:

From the previous conversation I used the code: {drCorrespondingRow}.CopyToDatatable

Which gives me the correct data perfectly however it looks like this on the PowerPoint slide:

Thanks!

@E.T.S

It is only a datarow …menas a row in a datatable but jot the full table

Cheers

Have you compared the size of the slide in both examples?

They are the same - no edits were done to the size

I thought with the data row I got I can generate a table with that row then input into the slide - but then I do not get the data table in the slide, instead I get the ‘system.data.datatable’

@E.T.S

Are you usign add text or add datatable activity?

Cheers

That’s because drCorrespondingRow is not a set of values, it’s the row object. If you want just the one row written to the slide you need to have it be the only row in an actual datatable.

@E.T.S ,

Could you try in the below way :

  1. Keep a Placeholder Table in your PPT file. Prepare this table format as required. Like below :

  2. Next, we can use the Add Datatable to Slide activity and overwrite the existing data present. This should preserve the format as maintained as Template.

Input Data :

Output :

It keeps the table format as maintained earlier unless your data exceeds the length of the column capacity maintained.

I’ve tried both

At the moment I am using add data table activity

With the add text activity it gives me a block of text rather than the table format

@E.T.S

Try to add the data row to a datatable using add data row actovity and then use the output datatable to add using add table to slide

Cheers

I’ve tried that unfortunately and it gives me system.data.datatable

I get this:

I used a read range then write range to get the Excel file so it is the same as the method:

However when I used a write range in Excel this is what is being written in the Excel file:

Again, you can’t do this. drCorrespondingRow is a row object, not an enumerable that can be converted to a datatable.

If you want the values in an array (which you can then use in an Add Data Row) then use drCorrespondingRow.ItemArray

How would I implement that in the workflow to get the values then add to the PowerPoint slide

The problem is when you’re giving drCorrespondingRow.tostring to Generate Data Table. You can’t just .ToString a datarow. There’s no reason to do this anyway, and no reason to then write it to Excel then read it back in.

If you have a datatable with your data in it, just give that datatable to the Add Data Table to Slide activity.

I am starting with an Excel file which with a read range outputs a data table - then I use code to give me a specific data row

Is there a way of removing the data row from the data table - I tried configuring a filter data table but it didn’t seem to work, maybe an assign would be better?

Just create a second datatable, and add the row to it using Add Data Row with CurrentRow.ItemArray (assuming you’re in a For Each Row in Datatable from the original dt) in the Array Row property.

  • For Each Row in Data Table dt_main
    ** Add Data Row CurrentRow.ItemArray to dt_temp
    ** Add Data Table to Slide with dt_temp

@E.T.S ,

Like already mentioned in your previous post, we could directly convert the Single DataRow to Datatable, so you could use the below Expression directly in the Add Datatable to Slide activity.

{drCorrespondingRow}.CopyToDatatable

Here, drCorrespondingRow is of the type System.Data.DataRow.

It was just added that you would need to maintain the Format of the Table in the PPT template as needed.