How to set clipboard from database

sorry for the maybe trivial POST, but I didn’t understand the instructions to create a Clipboard.
My project, extracts data from a database.
Associate to some elements of the variables and then create a string as in example

where the number after ROC- is the variable part, collected from the database.
ROC-"+ Number +"

With a for each loop, I can iterate through all the lines created by the bot.

I would need to create a clipboard that contains all these lines.
Is there any way to do it?

Thanks a lot…

1 Like

Do You mean you want to keep all these in a clipboard to paste it somewhere

Then we can use SET TO CLIPBOARD activity where we can pass the input in string format

Cheers @AaronMark

[quote=“Palaniyappan, post:2, topic:353005”]
Do You mean you want to keep all these in a clipboard to paste it somewhere

Yes, I would like to copy the entire list of lines,
in a clipboard for later use.
I don’t know how to generate the clipboard, starting from a “for each row …”
that is, I use the For Each Row to generate the “custom” string x each ID ROW present in the table …
The whole list, I’d like to put it on the clipboard.
The entire string will need to be copied to a web page.

Why are you pasting it somewhere? Can’t the automation just write the necessary value directly to wherever you are pasting?

Anyway, you have to do “myVar = myVar + somevalue” logic in your loop so that you concatenate each row into one variable (myVar or whatever you want to call it).

Then you could use Set To Clipboard and give it myVar.

Hi Postwick,
thanks x the comment.
…and, surely I have little experience with this command, but I don’t understand what you want to say to me.
I try to explain better:
In my flow, I start with a database extraction.
I have a table with several columns, but the element that interests me is the “roc id”, that is, the PYID column.
The PYID is the variable element of the string that I have to construct.

Right now, I’ve built the strings using a For Each Loop, x each ROC ID. (pyid)

FASTWEB-CUSTCARE-BACKOFFICE-WORK “+PYID+”;Resolved-Completed;ForceClose;false;;;

So, with a “write line” I visualize the result that I need to bring to a Clipboard

I would like to be able to paste the entire Clipboard into a page on a processing portal.

I tried to use the Type INTO, and it works, but the lines could be many, so the busy time would be too much, with the risk of causing the page to time out.

This is why I thought of the Clipboard to copy the entire database, in a single shot.

Unfortunately I do not know how to chain the list of lines that I have inserted in the Write Line, in a Clipboard, and from the instructions you have given me, I have not understood. Sorry… :expressionless:

what i understand is that you need the data in a container and then perform datatable operations after loading in UiPath?

If y are touching DB, let’s use that to get the data conveniently?

You can get the flat file (csv, excel) of the query easily. Then you can simply read that file and get your work done.

There are a lot of ways you can get the file created using sql. Below link will explain a few. Il recommend to use the script, use the sql command for your query, then add into outfile

myString = “”

For Each row in DT
assign myString = myString + rowdata + VbCrLf
// end for each

Type Into processing portal using MyString

No worries
If you kept this in a writeline activity then instead use a assign activity and place this expression like this

First assign before the loop

Str_final = String.Empty

Now inside the loop use a assign activity like

str_temp = “your below expression”

Then inside the same loop use a assign like this

Str_final = str_final + str_temp + Environment.NewLine

This will keep on concatenating the string and finally have it all in one string variable str_final

Now use SET TO CLIPBOARD and pass the variable str_final as input
Then we can paste that any where we want

Hope this would help you resolve this

Cheers @AaronMark

Hi Palani…
This is a great solution, and it works.

I’m not at this programming level.
Thaks a lot!!

ps: I also looked at the other suggestions.
I think those might have been fine too.
I figured out how to get the result, building the strings with a SQL query, but, this was the solution I was looking for. Thanks to all.

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