# Substitution not working

**URL:** <https://www.dolibarr.org/forum/t/substitution-not-working/21187>\
**Category:** Developing for Dolibarr\
**Created:** [September 16, 2021, 9:00am UTC](https://www.dolibarr.org/forum/t/substitution-not-working/21187 "2021-09-16T09:00:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johmarjac](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/9fc348/32.png) [@johmarjac](https://www.dolibarr.org/forum/u/johmarjac)\
**Post date:** [September 16, 2021, 9:00am UTC](https://www.dolibarr.org/forum/t/substitution-not-working/21187/1 "2021-09-16T09:00:46Z")

</div>

Hello,

in the module & application builder I created a new module. Then in the descriptor file I edited the module\_parts array to set substitutions to 1. I created the folder hierarchy

/usr/share/dolibarr/htdocs/custom/imrotec/core/substitutions  
and in there created a file with name functions\_imrotec.lib.php and copied the content that the wiki article has:

```php
/** Function called to complete substitution array (before generating on ODT, or a personalized email)
 * functions xxx_completesubstitutionarray are called by make_substitutions() if file
 * is inside directory htdocs/core/substitutions
 * 
 * @param	array $substitutionarray	Array with substitution key=>val
 * @param	Translate	$langs Output langs
 * @param	Object $object Object to use to get values
 * @return	void The entry parameter $substitutionarray is modified
 */
function imrotec_completesubstitutionarray(&$substitutionarray,$langs,$object)
{
   global $conf,$db;

   $myvalue='Put here calculated value to insert';
   $substitutionarray['myowntag']=$myvalue;
}

```

Now the module is activated but when I generate my ODT the tag “myowntag” is not being replaced. Any idea why ? Is this maybe outdated?

---

<div class="post-metadata">

**Author:** ![playcock](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/playcock/32/6009_2.png) [@playcock](https://www.dolibarr.org/forum/u/playcock)\
**Post date:** [April 7, 2022, 7:28pm UTC](https://www.dolibarr.org/forum/t/substitution-not-working/21187/2 "2022-04-07T19:28:34Z")

</div>

Did you put curly brackets around myowntag?

example:  
`{myowntag}`
