# Multiple Condition Javascript Logic

**URL:** https://community.feathery.io/t/multiple-condition-javascript-logic/567
**Category:** Support
**Created:** [March 24, 2024, 5:25pm UTC](https://community.feathery.io/t/multiple-condition-javascript-logic/567 "2024-03-24T17:25:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Beplace](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@Beplace](https://community.feathery.io/u/Beplace)
#### Post date: [March 24, 2024, 5:25pm UTC](https://community.feathery.io/t/multiple-condition-javascript-logic/567/1 "2024-03-24T17:25:02Z")

</div>

We currently have the following code - how do we adjust it to add multiple conditions so that the following statement reads “if aaa and bbb, then ccc”?

if (feathery.fields[‘aaa’].equals(‘Apple’))  
feathery.fields[‘ccc’].options = [‘Cherry’];

---

<div class="post-metadata">

### Author: ![summep](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@summep](https://community.feathery.io/u/summep)
#### Post date: [March 24, 2024, 7:56pm UTC](https://community.feathery.io/t/multiple-condition-javascript-logic/567/2 "2024-03-24T19:56:52Z")

</div>

Moving the answer to this post:

You can use Javascript’s includes method ([documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)).

```auto
if (a.value.includes('Apple') && a.value.includes('Apricot')) {
  c.options = ['Carrot', 'Cashew', 'Cherry', 'Cantaloupe']
}

```

---

<div class="post-metadata">

### Author: ![Beplace](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@Beplace](https://community.feathery.io/u/Beplace)
#### Post date: [March 24, 2024, 8:36pm UTC](https://community.feathery.io/t/multiple-condition-javascript-logic/567/3 "2024-03-24T20:36:51Z")

</div>

Just to confirm, would this be entered as the below?

if (feathery.fields[‘a’].value.includes(‘Apple’) && feathery.fields[‘a’].value.includes(‘Apricot’)) {  
feathery.fields[‘c’].options = [‘Carrot’,‘Cashew’,‘Cherry’,‘Cantaloupe’]  
}

---

<div class="post-metadata">

### Author: ![summep](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@summep](https://community.feathery.io/u/summep)
#### Post date: [March 24, 2024, 8:41pm UTC](https://community.feathery.io/t/multiple-condition-javascript-logic/567/4 "2024-03-24T20:41:57Z")

</div>

You can directly use the field’s name as well.
