# Working with shadow library macros and run time variable thing name and named shadow

**URL:** <https://forums.freertos.org/t/working-with-shadow-library-macros-and-run-time-variable-thing-name-and-named-shadow/13026>\
**Category:** AWS\
**Created:** [July 10, 2021, 3:48pm UTC](https://forums.freertos.org/t/working-with-shadow-library-macros-and-run-time-variable-thing-name-and-named-shadow/13026 "2021-07-10T15:48:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EyalG](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@EyalG](https://forums.freertos.org/u/EyalG)\
**Post date:** [July 10, 2021, 3:48pm UTC](https://forums.freertos.org/t/working-with-shadow-library-macros-and-run-time-variable-thing-name-and-named-shadow/13026/1 "2021-07-10T15:48:38Z")

</div>

I’m using the shadow library (1.1) in my AFR based IOT application running on STM32H7.  
As I understand, the shadow library macros (from shadow.h, e.g. SHADOW\_TOPIC\_STR\_UPDATE\_DELTA) that are used to create topic strings cannot accept variables as they are preprocess at compile time.  
My thing name (client id) is a variable that is loaded from another storage on the board at run time (that is, it is not a link time string constant like the demos are using), the same work for the named shadow.  
Is there any suggestion on how to handle this situation?  
Thanks

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 11, 2021, 12:33am UTC](https://forums.freertos.org/t/working-with-shadow-library-macros-and-run-time-variable-thing-name-and-named-shadow/13026/2 "2021-07-11T00:33:49Z")

</div>

According to [the documentation](https://docs.aws.amazon.com/embedded-csdk/202103.00/lib-ref/libraries/aws/device-shadow-for-aws-iot-embedded-sdk/docs/doxygen/output/html/group __shadow__ constants.html#gadc8a22bebccd83e6a01e6391f9abed4c) you need to use [Shadow\_GetTopicString()](https://docs.aws.amazon.com/embedded-csdk/202103.00/lib-ref/libraries/aws/device-shadow-for-aws-iot-embedded-sdk/docs/doxygen/output/html/shadow_8h.html#a1141285b0f4bf6315e3beb9f6ce2978a) if the thing name is not known at compile time.

---

<div class="post-metadata">

**Author:** ![EyalG](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@EyalG](https://forums.freertos.org/u/EyalG)\
**Post date:** [July 11, 2021, 7:22pm UTC](https://forums.freertos.org/t/working-with-shadow-library-macros-and-run-time-variable-thing-name-and-named-shadow/13026/3 "2021-07-11T19:22:34Z")

</div>

Thank you Richard,  
I was not aware to those functions.
