# Pick a random text string

**URL:** <https://community.make.com/t/pick-a-random-text-string/16694>\
**Category:** Questions\
**Tags:** arrays, functions\
**Created:** [September 28, 2023, 7:04am UTC](https://community.make.com/t/pick-a-random-text-string/16694 "2023-09-28T07:04:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![artur](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/artur/32/13263_2.png) [@artur](https://community.make.com/u/artur)\
**Post date:** [September 28, 2023, 7:04am UTC](https://community.make.com/t/pick-a-random-text-string/16694/1 "2023-09-28T07:04:59Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/1/d14519ae853684fb20cf265827bb5249dd2a6296.png)

Hi there, I aim to choose one random „Compose a string" module and then add a row to Google Sheets. In the first Compose a string text module content is „🟣 Someone texted you!” and in the second one „New message!". After that, I want to pick a random one and use it to add a row in Google Sheets. I have tried with the Set variable module, floor, and random functions but it seems like it’s only for numbers, so I was getting the “Not a number error”. 😃

Anyone? 😃

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [September 28, 2023, 8:08am UTC](https://community.make.com/t/pick-a-random-text-string/16694/2 "2023-09-28T08:08:53Z")

</div>

You can do it using a single “Set variable” module like this:

```plaintext
{{ if(round(random) = 0; "Someone texted you!"; "New message!") }}

```

 ![Screenshot_2023-09-28_180803](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/9/0999a5a006e2594aaf3a885d07525e02bc7f6b4b.png)

---

<div class="post-metadata">

**Author:** ![artur](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/artur/32/13263_2.png) [@artur](https://community.make.com/u/artur)\
**Post date:** [September 28, 2023, 10:47am UTC](https://community.make.com/t/pick-a-random-text-string/16694/3 "2023-09-28T10:47:25Z")

</div>

Thank you so much @samliew, that works perfectly for me!

Also, if in the future anyone would look for help with using modules – you can do It as well, just change the text in @samliew function to your module \<3

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [September 28, 2023, 11:03am UTC](https://community.make.com/t/pick-a-random-text-string/16694/4 "2023-09-28T11:03:35Z")

</div>

Revisiting this question, if you want to get a random value from more than two items, use the array `shuffle()` function:

`{{ first(shuffle(add(emptyarray; "Someone texted you!"; "New message!"; "Third option"; "Fourth option"))) }}`

![Screenshot_2023-09-28_190915](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/1/1/11d198c9edeb9eb17ed34a3f9ce34fb59514a272.png)

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [October 12, 2023, 11:07am UTC](https://community.make.com/t/pick-a-random-text-string/16694/5 "2023-10-12T11:07:18Z")

</div>

This topic was automatically closed because it's resolved or inactive. Please, start a new topic.


