Automation to Clear ALL Custom Fields
Asked by Nina Medlock:

Hey everyone,

I'm hoping that you'll be able to help me out with this one. We have a TON of custom fields on our boards, but they're not all the same. For example, we have a Leads board that will have custom fields for the "Last Contacted" date, "Email", "Phone", etc. while our Pipeline board will not necessarily need that information.

Is there a way to use the Butler to clear the information in all the custom fields on a card in the Leads board before moving it to the Pipeline board so that the card doesn't cause unnecessary custom fields to be created on its destination board?

I have set up some automation to clear most of the fields, but with the 20 command limit, I cannot remove them all with one command.


Answers:
author: Iain Dooley
body: [@Nina Medlock](/t5/user/viewprofilepage/user-id/4064830) you could use BenkoBot instead which has no command limits. I find the best way to do this is to copy the card, then clear custom fields and link the original to the copy. That way you have the full history while not cross pollinating your custom fields between boards.

<br />

This function will copy a card in this way to a new board when you move it to the "Move to Next Board" list:

<https://gist.github.com/iaindooley/a3a05912a78e8ad895192bdc1eec3616>

You can use this link to load the code into BenkoBot, just need to edit your list/board names up the top:

[Click here to load into BenkoBot](https://app.benkobot.com/addlistener?functionName=clearCustomFieldsAndCopyToNewBoard&code=dmFyIGZyb21fbGlzdG5hbWUgPSAiWU9VUiBDT01QTEVURUQgQ0FSRCBMSVNUIE5BTUUiOy8vdXBkYXRlIHRoaXMgd2l0aCB5b3VyIGFjdHVhbCBsaXN0IG5hbWUKdmFyIHRvX2JvYXJkbmFtZSA9ICJZT1VSIE5FWFQgQk9BUkQiOy8vdXBkYXRlIHRoaXMgd2l0aCB0aGUgbmV4dCBib2FyZCB0byBtb3ZlIHRvCnZhciB0b19saXN0bmFtZSA9ICJZT1VSIE5FWFQgTElTVCI7Ly91cGRhdGUgdGhpcyB3aXRoIHRoZSBuZXh0IGxpc3QgdG8gbW92ZSB0bwoKLy8vLy8vL0NPREUgR09FUyBCRUxPVyBIRVJFLy8vLy8vLy8vLwp2YXIgbW92ZWQgPSBuZXcgTm90aWZpY2F0aW9uKG5vdGlmaWNhdGlvbikubW92ZWRDYXJkKG5ldyBSZWdFeHAoIl4iK1JlZ0V4cC5lc2NhcGUoZnJvbV9saXN0bmFtZSkrIi4qIiwiaSIpKTsKdmFyIGNvcHkgPSBtb3ZlZC5jb3B5VG9MaXN0KG1vdmVkLmN1cnJlbnRMaXN0KCkpOwoKY29weS5ib2FyZCgpLmN1c3RvbUZpZWxkcygpLmVhY2goZnVuY3Rpb24oY2YpCnsKICBjb25zb2xlLmxvZygiTkFNRSBJUzogIitjZi5uYW1lKCkpOwogIAogIHRyeQogIHsKICAJY29weS5zZXRDdXN0b21GaWVsZFZhbHVlKGNmLm5hbWUoKSwiIik7CiAgfQogIAogIGNhdGNoKGUpCiAgewoJCiAgfQp9KTsKCmNvcHkuYXR0YWNoTGluayhtb3ZlZC5saW5rKCkpOwpjb3B5Lm1vdmVUb0xpc3QoCiAgbmV3IFRyZWxsaW5hdG9yKCkKICAgIC5ib2FyZChuZXcgUmVnRXhwKFJlZ0V4cC5lc2NhcGUodG9fYm9hcmRuYW1lKSwiaSIpKQogICAgLmZpbmRPckNyZWF0ZUxpc3QoCiAJCW5ldyBSZWdFeHAoIl4iK1JlZ0V4cC5lc2NhcGUodG9fbGlzdG5hbWUpKyIuKiIsImkiKQogICAgKQogICwidG9wIgopOwoKbW92ZWQuYXJjaGl2ZSgpOw==)

You will have to generate your API key and token first, but then you will have 10 free minutes. Once you run out of minutes you can pay USD$10/month if you want to keep it running, and you're able to install many more automations to run since that gets up to 5,000 execution minutes.

You can see other examples here:

<https://trello.com/b/IoHmhz5c/benkobot-community-board>


author: milynnus
body: [@Nina Medlock](/t5/user/viewprofilepage/user-id/4064830)

Any move or copy, as you have observed will cause the values to be inserted in the CFs with the same name.

Alternative you need a new card and use automation to carry only a selected list CFs to the new card. Did this for client to bring selected lot acquisition over to a lot holding board.

By the way, you need to upgrade from your free plan. 20 commands will be exhausted with 10 of the above automation.