# How to use the array variable in if and else to match the values

**URL:** https://community.yellow.ai/t/how-to-use-the-array-variable-in-if-and-else-to-match-the-values/2119
**Category:** Studio
**Tags:** builder
**Created:** [May 9, 2022, 10:21am UTC](https://community.yellow.ai/t/how-to-use-the-array-variable-in-if-and-else-to-match-the-values/2119 "2022-05-09T10:21:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Subrat](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Subrat](https://community.yellow.ai/u/Subrat)
#### Post date: [May 9, 2022, 10:21am UTC](https://community.yellow.ai/t/how-to-use-the-array-variable-in-if-and-else-to-match-the-values/2119/1 "2022-05-09T10:21:04Z")

</div>

case 1 : there is a string which is given by the use , now we have to match the substring(which are present in the array) to the string which is type/enter/provide by the end user.

---

<div class="post-metadata">

### Author: ![Pratik](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/pratik/32/69_2.png) [@Pratik](https://community.yellow.ai/u/Pratik)
#### Post date: [May 10, 2022, 8:41am UTC](https://community.yellow.ai/t/how-to-use-the-array-variable-in-if-and-else-to-match-the-values/2119/2 "2022-05-10T08:41:13Z")

</div>

Hey @Subrat  
It seems like this use case will require writing a cloud function. You can know more about cloud function here: [Code | yellow.ai](https://docs.yellow.ai/docs/platform_concepts/studio/cloud-function)
