Split String with mutiple columns and listing it using API

Hi,

I created an API and return columns with data separated by tilde. I then called the API in my preparation and created a logic wherein i split the data using split string. And then assign it my list of dependents variable. But when i call the list in source data it doesn't work. How will I assign my split string into a list variable and then list it in table. The data separated by tilde should be listed in the table in the image below. 


Hi Christian,

It depends a bit on how you want to store the data, but I would create a Structure with LastName, FirstName, MiddleName, RelationShip, DateOfBirth and EffectiveDate. Create both a Local Variable of that Structure and a Local Variable of a List of that Structure. Then, do a For Each over String_Split_Dep_LName.List, and assign the Current.Text.Value to the LastName of the Local Variable. Also assign the other Attributes (FirstName, MiddleName etc.) but since you are not looping over those, you can't use the Current. Instead, use direct indexing, like this:

String_Split_Dep_FName.List[String_Split_Dep_LName.List.CurrentRowNumber].Text.Value

Since all the lists seem to have the same number of elements, this should work. The dates would need some further massaging to convert them to a date, you would need to make a conversion routine if you need actual Dates.

EDIT: Once the Structure is filled, ListAppend it to the Local Variable List. That List can be used as Source List for the Table Records.

Kilian Hekhuis wrote:

Hi Christian,

It depends a bit on how you want to store the data, but I would create a Structure with LastName, FirstName, MiddleName, RelationShip, DateOfBirth and EffectiveDate. Create both a Local Variable of that Structure and a Local Variable of a List of that Structure. Then, do a For Each over String_Split_Dep_LName.List, and assign the Current.Text.Value to the LastName of the Local Variable. Also assign the other Attributes (FirstName, MiddleName etc.) but since you are not looping over those, you can't use the Current. Instead, use direct indexing, like this:

String_Split_Dep_FName.List[String_Split_Dep_LName.List.CurrentRowNumber].Text.Value

Since all the lists seem to have the same number of elements, this should work. The dates would need some further massaging to convert them to a date, you would need to make a conversion routine if you need actual Dates.

EDIT: Once the Structure is filled, ListAppend it to the Local Variable List. That List can be used as Source List for the Table Records.

Hi,


Can you provide sample on how to do this?


Solution

Here's a quick example.

Solution

Kilian Hekhuis wrote:

Here's a quick example.

Hi,


Thanks Killian it works :) 

Thanks for reporting back Christian, glad I could be of help. Try to understand what I did in relation to what I said above, and you'll have learned something :). Happy coding!