Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 4 5 8

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-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apinda-raw
icon clock
10 |1500

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

Upvotes
Accepted
39.4k 78 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 512.0 KiB each and 1.0 MiB total.

Upvotes
7 4 5 8

Thanks Alex!

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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