# Trying to understand limitations of secret referencing/templating

**URL:** https://community.doppler.com/t/trying-to-understand-limitations-of-secret-referencing-templating/1356
**Category:** Need Help
**Created:** [October 9, 2023, 2:18pm UTC](https://community.doppler.com/t/trying-to-understand-limitations-of-secret-referencing-templating/1356 "2023-10-09T14:18:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yasinzaehringer](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/yasinzaehringer/32/913_2.png) [@yasinzaehringer](https://community.doppler.com/u/yasinzaehringer)
#### Post date: [October 9, 2023, 2:18pm UTC](https://community.doppler.com/t/trying-to-understand-limitations-of-secret-referencing-templating/1356/1 "2023-10-09T14:18:06Z")

</div>

Hi all!

These might be actually two questions in one.

The first question is: is it true that a secret cannot not reference another secret which has references?

I am asking because I see this error (which is pretty conclusive tbh):  
`The secret "X" cannot reference ${global.X} because it references other secrets.`

The second question is: I would like to reference another secret but also transform the content of the secret. I.e., some kind of templating. In my current example I’d like to quote a string, since I inject a secret into a JSON object. I can work around it, but I just wanted to confirm that there is only straight string replacement is happening and higher powered templating functions aren’t available (yet).

Thank you very much!  
Yasin

---

<div class="post-metadata">

### Author: ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)
#### Post date: [October 11, 2023, 7:31pm UTC](https://community.doppler.com/t/trying-to-understand-limitations-of-secret-referencing-templating/1356/2 "2023-10-11T19:31:37Z")

</div>

Hi @yasinzaehringer!

> [@yasinzaehringer](#):
>
> is it true that a secret cannot not reference another secret which has references?

Yep! Currently we don’t support nested secret references. This is something we hope to add support for in the future though!

> [@yasinzaehringer](#):
>
> I would like to reference another secret but also transform the content of the secret. I.e., some kind of templating. … I just wanted to confirm that there is only straight string replacement is happening and higher powered templating functions aren’t available (yet).

That’s correct. We don’t yet have any more advanced templating/mutation options available for use when using secret references. I’ll go ahead and pass this request along to our team though!

Regards,  
-Joel
