# Empty Value Text in Macros

**URL:** <https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729>\
**Category:** Programming & Scripting\
**Tags:** error, macro, macro-library, text, macros, unreal-engine, crash, Blueprint, question\
**Created:** [September 5, 2024, 12:55am UTC](https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729 "2024-09-05T00:55:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weitagon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Weitagon](https://forums.unrealengine.com/u/Weitagon)\
**Post date:** [September 5, 2024, 12:55am UTC](https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729/1 "2024-09-05T00:55:50Z")

</div>

Hello,

Could someone tell me what is going wrong here? I’m trying to make a quick macro in my macro library for my actors to use that can take text and output the correct format. Only my macro library seems to really be struggling with Text variables. Does anyone know what is going on here? I realize I have redundant coding in the image, I was just trying to fix the issue.

Also, the macro seems to not accept any type in variables. I have to set a local variable for the macro to actually accept it unlike a float where I can just type that in. Not sure if my library is corrupted or if this is intended with the text variable. I’m guessing this has something to do with Text needing a reference? Would strings work instead here?

Any solutions? Thanks!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/0/4d0bd9d7e6b5dfa943a3c6f4673c7a71544a3020.png)

---

<div class="post-metadata">

**Author:** ![Weitagon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Weitagon](https://forums.unrealengine.com/u/Weitagon)\
**Post date:** [September 5, 2024, 1:23am UTC](https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729/2 "2024-09-05T01:23:03Z")

</div>

Using strings seemed to fix it if anyone else looks at this. I guess I don’t fully understand how to handle text variables.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/0/500ef82c037a248c40594ac364712a371c9cdffc.png)

---

<div class="post-metadata">

**Author:** ![silnarm](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/silnarm/32/955303_2.png) [@silnarm](https://forums.unrealengine.com/u/silnarm)\
**Post date:** [September 5, 2024, 1:58am UTC](https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729/3 "2024-09-05T01:58:05Z")

</div>

Hi,

The problem you encountered is indeed because `Text Is Empty` wants a reference, and macro parameters are not actually parameters, the compiler is trying to put the text in the `Text Is Empty` node the same as you do it where calling the macro, hence the error when that is not a variable (note that `Text Is Empty` node doesn’t allow you type some text in, must connect something).

Using a function instead of a macro would resolve the issue, but probably not so useful for your macro library 😜 Otherwise need to use (local) variables as you originally did, or use `Make Literal Text` and feed that into the macro.

Or use strings as you ended up doing, where the `Is Empty` node does not require a reference.

---

<div class="post-metadata">

**Author:** ![Weitagon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Weitagon](https://forums.unrealengine.com/u/Weitagon)\
**Post date:** [September 5, 2024, 6:03pm UTC](https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729/4 "2024-09-05T18:03:28Z")

</div>

Thank you for the explanation! The difference between empty and reference not existing for certain variables always catches me off guard.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [October 5, 2024, 6:03pm UTC](https://forums.unrealengine.com/t/empty-value-text-in-macros/2005729/5 "2024-10-05T18:03:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
