For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 2 2 6

How can I extend the IBarData in foreach (IBarData bar in chunk.Records.ToBarRecords()) to access other fields

I use NDA_RAW in my request and in the debugger I can see the records in the data chunk, but how can I access the individual keys in the dictionary?

            request = timeSeries.SetupDataRequest("ESc1")
                .WithView("NDA_RAW")
                .WithAllFields()
		.WithInterval(CommonInterval.Daily)
                .WithNumberOfPoints(10)
                .OnDataReceived(DataReceivedCallback)
                .CreateAndSend();

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonnda-raw
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
39.2k 75 11 27

You cannot get IBarData from NDA_RAW view. Instead you need to iterate through the records in chunk.Records and for each record item use record.AllFields, which returns a dictionary of field names and values, e.g.

foreach (IData record in chunk.Records)
{
    foreach (string key in record.AllFields.Keys)
    {
        Console.WriteLine(key + " : " + record.AllFields[key]);
    }
}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
7 2 2 6

Thanks Alex!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea