# @type {JSFoundSet

**URL:** https://forum.servoy.com/t/type-jsfoundset/18602
**Category:** Classic Servoy
**Created:** [October 20, 2015, 11:10am UTC](https://forum.servoy.com/t/type-jsfoundset/18602 "2015-10-20T11:10:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Peter\_de\_Groot](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@Peter\_de\_Groot](https://forum.servoy.com/u/Peter_de_Groot)
#### Post date: [October 20, 2015, 11:10am UTC](https://forum.servoy.com/t/type-jsfoundset/18602/1 "2015-10-20T11:10:15Z")

</div>

Hi all,

I need to set the tablename ```  
/\*\* @type {JSFoundSetdb:/someDatabase/tablename} \*/

```auto
dynamically to do so I create a variable and place the variable between the {}, something like this,

```

//$name is passed as param  
var $fsType = ‘JSFoundSetdb:/someDatabase/‘+$name+’’;

/\*\* @type {$fsType} \*/  
var $fs = databaseManager.getFoundSet(‘db:/someDatabase/’+$name);

```auto

Is this above code valid to dynamically set the **@type**?

Regards,

Peter
```

---

<div class="post-metadata">

### Author: ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)
#### Post date: [October 20, 2015, 12:10pm UTC](https://forum.servoy.com/t/type-jsfoundset/18602/2 "2015-10-20T12:10:08Z")

</div>

Hi Peter,

You can’t use variables in JSDoc (other than defining them).  
What is your use-case for this dynamic type?

---

<div class="post-metadata">

### Author: ![Peter\_de\_Groot](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@Peter\_de\_Groot](https://forum.servoy.com/u/Peter_de_Groot)
#### Post date: [October 20, 2015, 12:54pm UTC](https://forum.servoy.com/t/type-jsfoundset/18602/3 "2015-10-20T12:54:48Z")

</div>

Hi Robert,

I’m exporting data from different tables from our application server to a runtime solution.  
The exported record(s) is/are exported per table to a location on the users pc e.g. “c:\export\customer.json”,  
now to keep the import method generic I want to use the file name, “customer”, to compose the JSFoundset type.

Regards,

Peter

---

<div class="post-metadata">

### Author: ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)
#### Post date: [October 20, 2015, 1:03pm UTC](https://forum.servoy.com/t/type-jsfoundset/18602/4 "2015-10-20T13:03:41Z")

</div>

You can’t be generic, but then try to be specific. You either type your foundset as just that, any foundset (@type {JSFoundSet}) or you need separate methods for each table where you type the specific foundset.

---

<div class="post-metadata">

### Author: ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)
#### Post date: [October 20, 2015, 3:26pm UTC](https://forum.servoy.com/t/type-jsfoundset/18602/5 "2015-10-20T15:26:08Z")

</div>

Hi Peter,

Like what Patricks says, use the generic JSFoundSet type so your functions (newRecord, etc) will not throw any markers.  
You will probably be addressing any columns by $fs[‘columnName’] or $fs[someArray\*] anyway so that won’t throw any markers either.\*

---

<div class="post-metadata">

### Author: ![Peter\_de\_Groot](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@Peter\_de\_Groot](https://forum.servoy.com/u/Peter_de_Groot)
#### Post date: [October 21, 2015, 5:54am UTC](https://forum.servoy.com/t/type-jsfoundset/18602/6 "2015-10-21T05:54:20Z")

</div>

> ROCLASI:  
> Hi Peter,  
> You will probably be addressing any columns by $fs[‘columnName’] or $fs[someArray\*] anyway so that won’t throw any markers either.[/quote]\*  
> _Exactly, I’ve “full control”,_  
> _`* *{ "CUSTOMER": [{ "RECORD": [{ "coltype": "INTEGER", "colname": "customer_id", "value": "196" },* *`_  
> _So_  
> _`* _/** @type {JSFoundSet} */_ *`_  
> _will do._  
> _Regards,_  
> _Peter_
