# Getting JSDoc data of a caclulated field in runtime

**URL:** <https://forum.servoy.com/t/getting-jsdoc-data-of-a-caclulated-field-in-runtime/21136>\
**Category:** Questions\
**Created:** [January 11, 2024, 3:15pm UTC](https://forum.servoy.com/t/getting-jsdoc-data-of-a-caclulated-field-in-runtime/21136 "2024-01-11T15:15:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre1506345542](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@andre1506345542](https://forum.servoy.com/u/andre1506345542)\
**Post date:** [January 11, 2024, 3:15pm UTC](https://forum.servoy.com/t/getting-jsdoc-data-of-a-caclulated-field-in-runtime/21136/1 "2024-01-11T15:15:00Z")

</div>

Hi

Is het possible to get JSDoc data of a calculated field at runtime.  
For superuser we have a datamodel solution, where the get information about all the tables and fields. It also show the description we typed in at a particular field.  
But for calculated field we do not have that. Although we have a the info in the JSDoc.  
Is there a way to get this JSDoc info of calculated field on runtime.

Thanks for your help  
Andre

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [January 11, 2024, 5:03pm UTC](https://forum.servoy.com/t/getting-jsdoc-data-of-a-caclulated-field-in-runtime/21136/2 "2024-01-11T17:03:15Z")

</div>

Hi Andre,

something like this should do the job:

```auto
	var _sResult = null;
	
	var _jsDs = solutionModel.getDataSourceNode('db:/<DB_NAME>/<TABLE_NAME>');
	
	if(_jsDs) {
		var _jsCalc = _jsDs.getCalculation('<CALC_NAME>');
		if(_jsCalc) {
			var _sCode = _jsCalc.code;
			var _aMatch = _sCode.match(/\/\*\*([\s\S]*?)\*\//);
			
			if(_aMatch && _aMatch.length) {
				_sResult = _aMatch[0].replace(/@properties.*(\r?\n|$)/g, '');
			}
		}
	}
	
	return _sResult;

```

---

<div class="post-metadata">

**Author:** ![andre1506345542](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@andre1506345542](https://forum.servoy.com/u/andre1506345542)\
**Post date:** [January 15, 2024, 8:38am UTC](https://forum.servoy.com/t/getting-jsdoc-data-of-a-caclulated-field-in-runtime/21136/3 "2024-01-15T08:38:56Z")

</div>

Thanks Marc,  
Just what I needed. So you learn everyday. ![:-)]( "Smile")  
Andre
