# Match/Case Else?

**URL:** https://forums.fusetools.com/t/match-case-else/920
**Category:** How-to Discussions
**Created:** [April 20, 2016, 5:33pm UTC](https://forums.fusetools.com/t/match-case-else/920 "2016-04-20T17:33:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Fernando\_Lins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/fernando_lins/32/597_2.png) [@Fernando\_Lins](https://forums.fusetools.com/u/Fernando_Lins)
#### Post date: [April 20, 2016, 5:33pm UTC](https://forums.fusetools.com/t/match-case-else/920/1 "2016-04-20T17:33:11Z")

</div>

Hi,

I am working on some code that “gets” the first item in an `Each` loop and prints a special UI for it, using `<Each Items="{downloadItems}"><Match Items="{index}"><Case Number="0"> ... </Case></Match></Each>`.

However for all the other items in the Each loop I would like to print a different UI. How can I “else” this Match/Case block?

Something equivalent to the code below, but in UX?:

```auto
if (index == 1)
{
    printSpecialUI();
}
else
{
    printRegularUI();
}

```

---

<div class="post-metadata">

### Author: ![Edwin\_Reynoso](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@Edwin\_Reynoso](https://forums.fusetools.com/u/Edwin_Reynoso)
#### Post date: [April 20, 2016, 6:43pm UTC](https://forums.fusetools.com/t/match-case-else/920/2 "2016-04-20T18:43:09Z")

</div>

Match/Case would be like the switch statement so:

```auto
<Each>
  <Match Value="{index}">
    <Case Number="0">
      // special ui
    </Case>
    <Case Number="1">
      // special ui
    </Case>
  </Match>
</Each>

```

---

<div class="post-metadata">

### Author: ![Fernando\_Lins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/fernando_lins/32/597_2.png) [@Fernando\_Lins](https://forums.fusetools.com/u/Fernando_Lins)
#### Post date: [April 21, 2016, 3:29am UTC](https://forums.fusetools.com/t/match-case-else/920/3 "2016-04-21T03:29:39Z")

</div>

> **Edwin Reynoso wrote:**
> 
> Match/Case would be like the switch statement so:

Actually I just figured it out. You can use any other value and set it as the default, so if no other matches are found it will fall in that case.

```ux
<Case Number="0"> ... </Case>
<Case Number="100" IsDefault="true"> ... </Case>

```

Thanks!

---

<div class="post-metadata">

### Author: ![Edwin\_Reynoso](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@Edwin\_Reynoso](https://forums.fusetools.com/u/Edwin_Reynoso)
#### Post date: [April 21, 2016, 3:44am UTC](https://forums.fusetools.com/t/match-case-else/920/4 "2016-04-21T03:44:34Z")

</div>

Interesting I see its just like switch statements then where you have `default:`:

```auto

switch(someVal) {
  case 1:
      doSomething();
  case 2:
      doSomethingElse();
  default:
      doDefault();
}

```
