String output to datatable

Hi All ,
I am getting below data in string format out of which I need only 3 things into datatable.Can anyon eplease help on this.
Input: “12345,11,savePayment,DiffCreditDetails,radioNo,234567,123,100,23,unsavePayment,radioNo\r\n”

O/p: A/c num Amt. save/unsave Method
12345 11 savePayment
234567 100 unsavePayment
234567 23 unsavePayment

2 Likes

Split stirng on the basis of “,”…

The use the add data row to add the content to the datatable :slight_smile:

Hope this help :blush::blush:

2 Likes

I did this but its showing output like this:

12345 11
12345 savePayment
12345 savepayment

1 Like

Great suggestion Shubham!

Just to expound a little bit on your answer:

@somya177, you can do something like

StringArray = String.split(",")

This will give you an array and you can access elements like

AcNum=StringArray(0) , Amount= StringArray(1), SaveUnsaveMethod=stringArray(2)

Where AcNum, Amount,and SaveUnsaveMethod would be your local variables

3 Likes

Hi,

I am sharing you the code I have created…cn you please checkout and help in to receive the kind of output I have mentioned before.testcopy.xaml (29.9 KB)

hi @somya177,

I have one question regarding to your input. I see you are trying to ignore the value 123 from the output, is it something you are trying to do intentionally or 123 should also be in the O/P? I am just trying to understand your output patterns.

Best,
Sid

It’s one of the business requirements…that of there is value in the split amount cell then main payment amount cell value needs to be ignored.so I’m ignoring it internationally

it is failing for other string values.This data I am getting as a result from customForm.
I have already added amount and accountNumber but I am unable to incorporate savePayment to dataTable.can you please check my above flow and suggest change in that only?