# Access data on a json file or csv file on a Database

**URL:** https://community.cumulocity.com/t/access-data-on-a-json-file-or-csv-file-on-a-database/7263
**Category:** Forum
**Tags:** cumulocity, Streaming-Analytics-Apama
**Created:** [December 13, 2023, 10:24am UTC](https://community.cumulocity.com/t/access-data-on-a-json-file-or-csv-file-on-a-database/7263 "2023-12-13T10:24:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gabriele.chiossi](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@gabriele.chiossi](https://community.cumulocity.com/u/gabriele.chiossi)
#### Post date: [December 13, 2023, 10:24am UTC](https://community.cumulocity.com/t/access-data-on-a-json-file-or-csv-file-on-a-database/7263/1 "2023-12-13T10:24:22Z")

</div>

Hello all,  
I am exploring the feasibility of accessing a JSON or CSV file in the EPL program through MongoDD database interaction, similar to how it’s done with Pandas in Python for an Excel file.  
I came across this resource on the Apama Database: ([ApamaDoc](https://documentation.softwareag.com/pam/10.15.1/en/webhelp/related/ApamaDoc/)).

Could you provide a simple example of how to access a 2x2 table using these API calls? Would it be similar to how we access measurements? For instance, if I have a table like:

| Child device ID | Email To |
| --- | --- |
| 123456789 | [xxx.xxx@xxx.com, [yyy.yyy@yyy.com](mailto:yyy.yyy@yyy.com)] |
| 987654321 | [zzz.zzz@zzz.com, [www.www@www.com](mailto:www.www@www.com)] |

```auto
on all (Measurement(type="Child device ID") as ChildDeviceID and Measurement(type="Email To") as EmailTo)
		{

```

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [December 13, 2023, 12:48pm UTC](https://community.cumulocity.com/t/access-data-on-a-json-file-or-csv-file-on-a-database/7263/2 "2023-12-13T12:48:16Z")

</div>

Hi Gabriele,

could you explain what you mean by database access? Do you mean an external SQL database?

If you do not have a specific table you want to connect to, you can use the Cumulocity Inventory API. You would store the JSON inside a managed object:  
[https://documentation.softwareag.com/pam/10.15.1/en/webhelp/related/ApamaDoc/com/apama/cumulocity/ManagedObject.html](https://documentation.softwareag.com/pam/10.15.1/en/webhelp/related/ApamaDoc/com/apama/cumulocity/ManagedObject.html)

and could then search for it like this:  
[https://documentation.softwareag.com/pam/10.15.1/en/webhelp/related/ApamaDoc/com/apama/cumulocity/FindManagedObject.html](https://documentation.softwareag.com/pam/10.15.1/en/webhelp/related/ApamaDoc/com/apama/cumulocity/FindManagedObject.html)

or update it by sending back the Managed Object to Cumulocity IoT.

---

<div class="post-metadata">

### Author: ![gabriele.chiossi](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@gabriele.chiossi](https://community.cumulocity.com/u/gabriele.chiossi)
#### Post date: [December 13, 2023, 1:07pm UTC](https://community.cumulocity.com/t/access-data-on-a-json-file-or-csv-file-on-a-database/7263/3 "2023-12-13T13:07:19Z")

</div>

Hello Harald,  
Let’s start by noting that this is a MongoDB database, which is a document-oriented or NoSQL database.  
This database is the database of cumulocity, where APAMA resides.  
I would like guidance on accessing the database from the initial setup and retrieving data from it. The table structure could be a simple 2x2 table, similar to the one I mentioned in the previous message.

I’ve explored the APAMA documentation, but I find myself a bit lost. That’s why I’m turning to the knowledgeable APAMA community for assistance.  
If you need additional information from my end, please feel free to ask.  
I’m eager to learn how to accomplish this task.  
Thank you once again.

---

<div class="post-metadata">

### Author: ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)
#### Post date: [June 10, 2024, 1:07pm UTC](https://community.cumulocity.com/t/access-data-on-a-json-file-or-csv-file-on-a-database/7263/4 "2024-06-10T13:07:43Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
