Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How acess data after retrieving it from a web service

Avatar

Level 1

I am a newbie

I suceed in geting data from a web service am puting it in an arraycollection using the following code

The data comes from a SQL table with 10 rows and 5 collumns.

public mydata : ArrayColection;

Private function datadandler(event:ResultEvent):void

mydata=event.result.Tables.table.rows;

My doubt now is how can I extract the data from each collumn and row of the ArrayCollection.

I need to access one specific collumn and use the value from that collumn

thanks in advance

1 Reply

Avatar

Former Community Member

It depends on how the data is formed when it comes back and is put in the ArrayCollection.

In general, you can access the 6th row of an ArrayCollection lilke this:

myAC.getItemAt(5);

You can loop through ab ArrayCollection like this:

for each(var obj:Object in myAC){

  trace(obj);

}

But then the question becomes how are the fields in each row of data formed?

If the rows of data are objects, you could access the data like this:

myAC.getItemAt(5).custName or sometimes like this:myAC.getItemAt(5)[custName]

So it depends how you data is coming back.

If this post answers your question or helps, please mark it as such.