Split String basde on a new line

Hello All
i’m Trying To Split a String based on a new Line
i Got These Generated Codes

i want To split one item For Every new line
Then i want to add it To a column already Created in a datatable

For Each Row in my Datatable should Have One Code
How Can I Do that ?

Hi @Karam_Abulawii

  1. Need to get the generated codes - use Screen scraping. or try to use Flowchart to get the codes.
  2. Use Assign Activity to split the codes (Site_List; Screen scraping variable)
    Variable Type: Array of String

Hope it will work


Thanks For the Reply
But in The assign
what in (to) Should be ?
array variable or What ?


Yes, it should be of type Array of String.

1 Like

Thank You
but Theni want To add it to a column in my Data table
i got Column (GUID)
i want to store each index in that array in each Row in my Datatable
Can You Show what to Do or an Example ?
Thanks in Advance

Hi @Karam_Abulawii

Could you share me a screen shot of your workflow?


GuidCodeGenerator.xaml (17.1 KB)
Here is the Workflow Can you Do it For Me ?

Assignment_Generate JWT_Dispatcher.zip (1.0 MB)
and here’s my Dispatcher File so you Can See the Whole Proccess
and Feel Free To Modify it

Hi @Karam_Abulawii

Refer to the xaml modified xaml below!

GuidCodeGenerator.xaml (22.2 KB)


Thank you @pravin_calvin
But is splitting the generated codes with you ?

It’s not splitting the Generated Codes with me and it’s not writing anything in the Excel File

Hi @Karam_Abulawii

Check with your read datatable and write datatable excel path are same
So that it can update it accordingly in same file!

Get the Scraped value in write text file and Share it here!


Here is The Scraped Generated Codes

Hi @Karam_Abulawii,

  • I use dummy values with Enviornment.Newline to seperate them and then convert the string (scrapped string in your case) to an array.

  • Build a datatable (OutputDatatable) where I can store the items of the array in a column named GUID.

  • Iterate through the items in the array. Add data rows to OutputDatatable and pass the item of the array in the loop.

  • Output will be your GUIDs in a datatable.

Hope this helps clear your doubt. Always try to break the automation into smaller steps and find alternative ways to achieve each of the steps. This will help you reuse smaller chucks of your code in other problems as well.

Here is the sample xaml file: SpiltTextNewLineToDataTable.xaml (9.4 KB)


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