# How to use datasources.mem ?

**URL:** <https://forum.servoy.com/t/how-to-use-datasources-mem/18188>\
**Category:** Classic Servoy\
**Created:** [September 26, 2014, 10:47am UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188 "2014-09-26T10:47:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![deezzub](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@deezzub](https://forum.servoy.com/u/deezzub)\
**Post date:** [September 26, 2014, 10:47am UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/1 "2014-09-26T10:47:49Z")

</div>

In the JSDoc of mem, I found.:

> mem: MemDataSource
> 
> Scope property for in-memory data sources.
> 
> datasources.mem[‘myds’]
> 
> @return MemDataSource

I tried:

```auto
datasources.mem[foundset.getDataSource( )].getFoundSet( );

```

but it does not work. What is ‘myds’ and how can I use datasources.mem?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 23, 2014, 8:20am UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/2 "2014-10-23T08:20:32Z")

</div>

the id is the id that you gave when you created the in mem datasource  
the getDataSource === a full url including the id (so mem:id) you only should work with the id.

---

<div class="post-metadata">

**Author:** ![deezzub](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@deezzub](https://forum.servoy.com/u/deezzub)\
**Post date:** [October 23, 2014, 11:44am UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/3 "2014-10-23T11:44:56Z")

</div>

> jcompagner:  
> the id is the id that you gave when you created the in mem datasource  
> the getDataSource === a full url including the id (so mem:id) you only should work with the id.

What “id” do you mean? I don’t have created an in mem datasource. I want to create one. So first I need to create an inmem datasource, so that I can use the inmem datasource?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 24, 2014, 9:54am UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/4 "2014-10-24T09:54:12Z")

</div>

yes ofcourse you first have to create one in your solution, how else would you ask for a foundset?  
You also have to have a server/table combination before you can ask for a (normal) foundset.

---

<div class="post-metadata">

**Author:** ![deezzub](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@deezzub](https://forum.servoy.com/u/deezzub)\
**Post date:** [October 24, 2014, 2:11pm UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/5 "2014-10-24T14:11:06Z")

</div>

> jcompagner:  
> yes ofcourse you first have to create one in your solution, how else would you ask for a foundset?  
> You also have to have a server/table combination before you can ask for a (normal) foundset.

Yes, I don’t see how I can create and use a inmem datasource, because there is no information in JSDoc about that. Where do I have to look in the wiki? I googled but found no information.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 24, 2014, 2:18pm UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/6 "2014-10-24T14:18:31Z")

</div>

[https://wiki.servoy.com/dosearchsite.ac … e=conf\_all](https://wiki.servoy.com/dosearchsite.action?queryString=createDataSource%20createDataSourceByQuery&startIndex=0&where=conf_all)

---

<div class="post-metadata">

**Author:** ![deezzub](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@deezzub](https://forum.servoy.com/u/deezzub)\
**Post date:** [December 16, 2014, 11:27am UTC](https://forum.servoy.com/t/how-to-use-datasources-mem/18188/7 "2014-12-16T11:27:50Z")

</div>

Is this the correct creation of an in-memory foundset?

```auto
var dataSet = databaseManager.convertToDataSet( foundset );
var dataSource = dataSet.createDataSource( 'name' );
var inMemFS = datasources.mem[dataSource].getFoundSet( );
inMemFS.loadAllRecords( );

```
