# Seting property in Match not working...

**URL:** <https://forums.fusetools.com/t/seting-property-in-match-not-working/3101>\
**Category:** How-to Discussions\
**Created:** [August 18, 2016, 10:54am UTC](https://forums.fusetools.com/t/seting-property-in-match-not-working/3101 "2016-08-18T10:54:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mojo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mojo/32/167_2.png) [@Mojo](https://forums.fusetools.com/u/Mojo)\
**Post date:** [August 18, 2016, 10:54am UTC](https://forums.fusetools.com/t/seting-property-in-match-not-working/3101/1 "2016-08-18T10:54:30Z")

</div>

hi Guys

Not sure if I got this right but here it goes…

I’m creating a reusable component (button) that changes its color based on the “type” of button it is… similar to Bootstrap buttons.

I am using the MATCH condition to do this, and passing the property BtnType with value “success” or “warning”

[![](http://i.imgur.com/Ae24CHm.jpg) ](http://i.imgur.com/Ae24CHm.jpg)

Dunno what’s wrong with the above code, but it’s not working. No errors neither… What am I missing here?

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [August 18, 2016, 11:26am UTC](https://forums.fusetools.com/t/seting-property-in-match-not-working/3101/2 "2016-08-18T11:26:49Z")

</div>

[This](https://www.fusetools.com/community/forums/permalink/e61540fd-6dca-4d97-9b13-911f61b080d5) very recent post should be relevant. 🙂 (specifically points 2 and 3)

---

<div class="post-metadata">

**Author:** ![Mojo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mojo/32/167_2.png) [@Mojo](https://forums.fusetools.com/u/Mojo)\
**Post date:** [August 18, 2016, 12:36pm UTC](https://forums.fusetools.com/t/seting-property-in-match-not-working/3101/3 "2016-08-18T12:36:08Z")

</div>

> **Remi Pedersen wrote:**
> 
> [This](https://www.fusetools.com/community/forums/permalink/e61540fd-6dca-4d97-9b13-911f61b080d5) very recent post should be relevant. 🙂 (specifically points 2 and 3)

Hi Remi,  
read the post. I understand and based on 2 and specially 3, I changed my code to the following:

```
  <Match String="{Property this.BtnType}">
    <Case String="success"> <Rectangle CornerRadius="4" Layer="Background" Color="#00cc00" />	</Case>
	 <Case String="warning"> <Rectangle CornerRadius="4" Layer="Background" Color="Yellow" /> </Case>
  </Match>        						        

```

Works quite well…

Thank you

I could just make an observable for BtnType and let JS do the logic but that’s additional code work and dependency… So I chose to just simplify the reusable component with the above match case instead, and not deal w/ JS dependency.

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [August 18, 2016, 12:55pm UTC](https://forums.fusetools.com/t/seting-property-in-match-not-working/3101/4 "2016-08-18T12:55:37Z")

</div>

That sounds like the right decision to me. Good to hear you got it working! 🙂
