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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-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.

Hello @jerome

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvotes
Accepted
39.4k 77 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.