# Function to set component property

**URL:** <https://forum.inductiveautomation.com/t/function-to-set-component-property/15074>\
**Category:** Ignition\
**Created:** [August 15, 2017, 7:51pm UTC](https://forum.inductiveautomation.com/t/function-to-set-component-property/15074 "2017-08-15T19:51:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [August 15, 2017, 8:48pm UTC](https://forum.inductiveautomation.com/t/function-to-set-component-property/15074/2 "2017-08-15T20:48:00Z")

</div>

This works:

```auto
def setPropertyValue(component,propertyName,value):
	method = getattr(component,"set%s"% propertyName.title())	
 	method(value)

```

In this function we get the set method of the property and then call it to set the value.

---

_[View the full topic](https://forum.inductiveautomation.com/t/function-to-set-component-property/15074)._
