Butler - how to set a label based on a variable
Asked by Hannah Humbert - Simpla Workflows:

Hi there! I'm wanting to create a rule that looks something like this:  

"When custom dropdown is set, apply the label {customfieldvalue}."  

So, let's say the custom field is set to "DOG", it should apply the "DOG" label.  

If the label exists, it should apply the pre-existing label. If the label does not exist, it should create a new one.   

Is it possible?


Answers:
author: milynnus
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

Possible if you use custom labels using one colour and it creates one if the name does not exist.

comments: author: Hannah Humbert - Simpla Workflows
body: Thanks [@milynnus](/t5/user/viewprofilepage/user-id/3947182) for the reply. I can't seem to add a variable into the label action, I only see the option to select an existing label ? what am I missing?![Screenshot_20210629-220024_Chrome.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/149277i5464B876257972B3/image-size/large?v=v2&px=999 "Screenshot_20210629-220024_Chrome.jpg")


author: milynnus
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

Choose any invisible custom label(aka with a name) Then replace the name with your cf value

If I recall, Trello will find a matching name and use the colour.


author: milynnus
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

Or temporary create a custom label for the colour of your choice. Then replace the name


author: Hannah Humbert - Simpla Workflows
body: Sorry if I'm not understanding your answer, but would that mean I'd have to create a different rule for each cf value? I currently have a label already created for each cf value, but I want to avoid having to create a separate rule for each cf value. The goal is to just have one rule and I don't have to create a new rule and a new label everytime a new cf value is created, so ideally if would just say "when cf is set, add label with cf value".


author: milynnus
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

Watch the video

<https://www.loom.com/share/2dbed447ede24738b8f43081e5292266>

If there is a CF with no corresponding label and invisible label with the name will be created.

That is why if you want a coloured label instead of an invisible one that use a temporary custom label (ie with a name) of the colour of your choice and replace the temporary name with {customfieldvalue}


author: Hannah Humbert - Simpla Workflows
body: [@milynnus](/t5/user/viewprofilepage/user-id/3947182) thanks so much for taking the time to record the video! I finally managed to get it working as expected. The part that I was getting hung up on was that I actually had to create a label called "{customfieldvalue}". Thank you again!![Screenshot 2021-06-30 172622.png](https://community.atlassian.com/t5/image/serverpage/image-id/149443i2A95D785319E92EF/image-size/large?v=v2&px=999 "Screenshot 2021-06-30 172622.png")


author: milynnus
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

Hmm that result is different from what I had experienced. What is got was an invisible label with name equal to to {customfieldvalue}


author: Martin Durrant
body: How can we delete these 'invisible' labels. It seems once they are set they can not be removed?