MS SQL Connection

I’m trying to connect to a database and fetch all the rows from a table by using below code.


Its working fine but the whole row from database comes in a single cell when exported like below.
I need it in table format in excel or csv. Can anyone suggest?

@abulka Can you pls suggest??

Hello Shwetha.
Are you talking about RPA Express bot task or about SPA?

@valeryia_rabchykava Its RPA Express bot task

1 Like

Hi @sb00465063 try using tableFromString method from our RPA API

Or, as a workaround, you can use 2 Clipboard actions from the Actions Library - first copy the value of the string to the clipboard, then - save it in a table.

Hi @ashapkina i’m not using recorder for this. This is done in xml in WorkFusion studio.

Try using tableFromString then. You can find details in the link I shared in the previous post.

@ashapkina if you could pls share sample code on to how to use it, it would be great.
Thanks :slight_smile:

I also tried using the below code provided in kb, but it gave me error "No signature of method: Script1.rowAsMap() is applicable for argument types: (groovy.sql.GroovyRowResult) values: [[AutoId:1, UserId:-----, PhoneNo:------, PrimaryQuery:plan change, …]] "



Here is an example of splitting a String variable in a Table using Linux line break as row separator and Comma as column separator:

my_table = StringRepresentations.tableFromString(my_string, "\n",",", "", true)