Data Table columns to clip board

Hi,
I have a data table. I need to copy all the rows of one of the column values to clip board. Is there a way of doing it?

Manually I select the cells of the column and doing copy and paste. How to mimick this with UiPath data table.

Thank you so much,

You can’t. That clipboard functionality is specific to Excel.

What are you trying to do? There shouldn’t be any reason to do this. If you’re trying to move data to Excel, use the Excel activities.

Thank you, @postwick.
I need to copy all the column values to a web page. In the web page, there is a table. I can get column value by value and paste it into the table cell using selectors, finding the proper table row.

On the other hand the application has a paste from clipboard activity using which I can paste the selected columns into the cells.

For this I need to have the column data in a clip board.

Thank you,

Hi @A_Learner

Try this

String.Join(Environment.NewLine, dt.AsEnumerable().Select(Function(row) row("YourColumnName").ToString()))

Regards,

2 Likes

Worked great! Thank you @lrtetala

2 Likes

You wouldn’t use copy/paste for this. You’d use UI Automation and either Type Into or Set Text.

the application has a paste from clipboard activity

What format does it need the data to be in? These are the kind of details we need in order to help you. Just saying “column data in the clipboard” isn’t detail.

Text format only.

Thank you,

Text is still vague. I know you already found a solution, but it’s important to provide detail when asking questions. Text could mean comma delimited, each value on a separate line, fixed length, some other custom text format, etc.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.