cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anjali_Rani
Helper I
Helper I

To create DataTable in Power Automate Desktop

Hi everyone,

 

Can any one tell me ,

1) how e can add Datatable activity in Power automate desktop, ?

2) How we can store in dadatble variable, so that finally we write that variable into ExcelFile?

3) How to convert variable to Datatable?

 

 

 

 

Please help me!!

I have to store value in Excel file,Any suggestions/Hint will work.

 

Please give suggestions.

Thanks in Advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ryule
Skilled Sharer
Skilled Sharer

Information on creating your own DataTable is located under "Datatable" under Advanced Data Types in this link:

 

https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-type...

 

I, however, have not discovered a way to insert a variable into a custom datatable....so if anyone knows how to do that, I'm all ears. I've had to use Excel as a workaround, like you had mentioned.

View solution in original post

12 REPLIES 12
ryule
Skilled Sharer
Skilled Sharer

Information on creating your own DataTable is located under "Datatable" under Advanced Data Types in this link:

 

https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-type...

 

I, however, have not discovered a way to insert a variable into a custom datatable....so if anyone knows how to do that, I'm all ears. I've had to use Excel as a workaround, like you had mentioned.

Thanks, This helped a lot.

 

Thank you so much. 🙂

Use %vData + [rowd, rowdd]% where rowd , rowdd are variables and vData is datatable.

korebreach2022
Regular Visitor

The key to using variables to set items in a datatable (which makes little sense) is to remove the % signs from both ends of the variable.  Where you may think that %MyTable + [%variable1%, %variable2%]% would be correct, it's actually %MyTable + [variable1, variable2]% .  This is a strange quirk of the engine because if you enclose the variables in % signs (like you would do anywhere else) PAD will try to "pair" the % at the start of the first variable with the % at the start of the statement, essentially making a variable called, "%MyTable +[%". The information following that incorrect variable is then interpreted as garbage so it throws an error.

ryule
Skilled Sharer
Skilled Sharer

Yes I have since discovered that; thanks! And I just saw they introduced some new DataTable actions, but haven't checked them out yet!

https://powerautomate.microsoft.com/en-us/blog/power-automate-for-desktop-july-2022-update/

hoernchen
Frequent Visitor

Hi all, I have checked it out and I did not manage to add data to a data table row. Which format is needed to do that? My tries with a defined table of 4 colums were:

2022-07-28 11_58_17-Window.jpg

 

  • 1,2,3,4
  • 1;2;3;4
  • "1";"2";"3";"4"
  • '1';'2';'3';'4'
  • 1+2+3+4
  • ['1'] + ......... 

Any info how to solve that?

 

@microsoft colleagues:

  • Would be great if those infos will be added directly to the info button next to each step, it's always a try and error
  • There's an option to delete a row, why isn't there a option to delete a column as well?
ryule
Skilled Sharer
Skilled Sharer

I 100% agree with you that you should be able to insert new data directly into the table. I haven't figured out how to do it using these new Actions.

I did discover you can insert a row into the datatable with a list, as long as the list has the same amount of rows as the datatable has columns.

So for instance, below, I created a list with 3 rows of values, and then created a datatable with 3 columns, then inserted the list as a row, and it worked....

ryule_0-1659025555454.png

 

You came pretty close with your last try. It should look like this:

JCiriello98_0-1659721281904.png

So the format for a datarow is a comma separated list contained by square brackets inside of percentage signs.

Note how ColumnNVariable are variable names containing the values DataN, while 'Data3' and 'Data4' are hardcoded values contained in single quotes.

 

This is what the datatable looks like after the insert step has run:

JCiriello98_1-1659721497901.png

*I created the datatable with the InitN values already there before the insert happened.

See my response to hoernchen above on how to insert a row to a data table without making a list first.

can't believe i never tried that combination; nicely done, thank you!

Niraj466
Helper I
Helper I

what @JCiriello98 mentioned, that works. However, it doesn't make sense to have first row (row 0) must be available. I'm appending dynamic rows and this row 0 was required to delete at later step. 

 

I followed the older method using Set variable to create data table.

 

Niraj466_0-1660666443454.png

 

However, I'm seeing that the column name are not actually created what I mentioned as list. If we see, I used '_' (underscore) for the columns names : 'Queue_Name', 'Row_Id', 'Queue_Id' while defining column names (^ caret sign) in Set variable. But if we see this in Variable value after running this action, the column name values are updated without underscore. [Underscore is still available with the first column name : 'DTStatus_ToUpdte'.]

 

Please note that I made the correction (from without underscore to with underscore) in column names later for better readability. It looks like something memory issue. This happens even after rebooting machine as well.

 

Anyone have idea why the latest column names are not updating in Data table flow variable? This is failing at the further step where the column names are used with and without underscore.

 

 

 

Great, thx for the solution (at least for my question 😊 )

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Top Solution Authors
Top Kudoed Authors
Users online (2,989)