# Creating a list of either one or two items based on a condition

**URL:** <https://community.thunkable.com/t/creating-a-list-of-either-one-or-two-items-based-on-a-condition/2239336>\
**Category:** Questions about Thunkable X\
**Tags:** object\
**Created:** [January 24, 2023, 7:30pm UTC](https://community.thunkable.com/t/creating-a-list-of-either-one-or-two-items-based-on-a-condition/2239336 "2023-01-24T19:30:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 24, 2023, 7:30pm UTC](https://community.thunkable.com/t/creating-a-list-of-either-one-or-two-items-based-on-a-condition/2239336/1 "2023-01-24T19:30:53Z")

</div>

I’m submitting JSON to an API and creating an object with the prompts for Open AI’s chat bot. I know this screenshot looks complicated but I’m basically wanting to have a list with one item if `Negative prompt text input` is empty (“”). If it’s not empty and the user typed something in, I want to add a second list item.

What _does_ work is to add a space (" “) to the list. But that seems like an odd solution. I thought it would work to use an `empty list` or `null` block in place of the space (” ") text block but it doesn’t.

**Edit:** actually, now it’s **not** working with the space text block. It may have been a caching problem with Thunkable Live (it’s hard to know which version of a project is running!).

Any thoughts about how to do this differently?

Here are the blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/3/f351240655315e46254c0fcee657454b7039d65d.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 24, 2023, 7:40pm UTC](https://community.thunkable.com/t/creating-a-list-of-either-one-or-two-items-based-on-a-condition/2239336/2 "2023-01-24T19:40:10Z")

</div>

Answered my own question! I lost sight of the fact that I was working with objects. The empty text string (or space text string) has to be part of an object:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/f/1ff96a3f88d9d5960069480f22f0a65b92f83e2c.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [April 24, 2023, 7:40pm UTC](https://community.thunkable.com/t/creating-a-list-of-either-one-or-two-items-based-on-a-condition/2239336/3 "2023-04-24T19:40:21Z")

</div>

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