# Unit 4 Decision App Help

**URL:** <https://forum.code.org/t/unit-4-decision-app-help/39312>\
**Category:** Coding and Debugging Help\
**Created:** [April 16, 2024, 7:23pm UTC](https://forum.code.org/t/unit-4-decision-app-help/39312 "2024-04-16T19:23:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jedavis1](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jedavis1/32/8360_2.png) [@jedavis1](https://forum.code.org/u/jedavis1)\
**Post date:** [April 16, 2024, 7:23pm UTC](https://forum.code.org/t/unit-4-decision-app-help/39312/1 "2024-04-16T19:23:24Z")

</div>

**Link to the project or level:** [([App Lab - Code.org](https://studio.code.org/projects/applab/uZHGeQHiSm_kQ00eqTryDd9059Yi7G2V6Y_Nf1hH5sM/view))]  
**What I expect to happen:** The code runs okay, but with an error.  
**What actually happens:** We get the following error with a red square: “WARNING: Line: 28: setText() text parameter value (undefined) is not a uistring.  
ERROR: Line: 28: TypeError: Cannot read properties of undefined (reading ‘toString’)”

We would like it to run without the error.

---

<div class="post-metadata">

**Author:** ![lindsay.davis](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/lindsay.davis/32/7632_2.png) [@lindsay.davis](https://forum.code.org/u/lindsay.davis)\
**Post date:** [April 16, 2024, 8:04pm UTC](https://forum.code.org/t/unit-4-decision-app-help/39312/2 "2024-04-16T20:04:03Z")

</div>

Hi, thanks for posting on the forum, this project has a good start! I took a look and see what the problem is–

When only one of the dropdowns has been selected, none of the if else statements have true conditions yet, and the Shoes variable is empty, so there is nothing for the setText to show.

There are several ways to fix this. One is to set the Shoes variable equal to an empty string at the top of the code where you declare it, like this:

var Shoes = “”;

Another way is to include an else statement in your conditional block that will assign a value to Shoes no matter what, like I did here:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/8/806e45b080a69b5943aec8188b241e94a8ac79e5.png)

Best,  
Lindsay

---

<div class="post-metadata">

**Author:** ![jedavis1](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jedavis1/32/8360_2.png) [@jedavis1](https://forum.code.org/u/jedavis1)\
**Post date:** [April 16, 2024, 8:33pm UTC](https://forum.code.org/t/unit-4-decision-app-help/39312/3 "2024-04-16T20:33:31Z")

</div>

Thanks so much, this is perfect! I really appreciate the help.
