Extracting using multiple wildcards
Asked by Matt Page:

Hi,

I'm pretty new to Trello and trying to get my head around Butler and wildcards.

Basically I want to extract various chunks of text from the description when a new card is added / moved and put them into custom fields. I've worked out how to do it OK for one, but I can't see how to do it for 4-7 different fields.

So as an example my description might be

Name: Bob Smith

Job Title: Manager

Company: Acme Ltd

Order#: 123456

I want to pull the text from each line (after the colon) into a different custom field. I thought if I included some other identifiers, regex style I might be able to pull this off, but seem to be struggling.  

Does anyone have any ideas (or a totally different way of doing this?)

Thanks

Matt


Answers:
author: milynnus
body: [@Matt Page](/t5/user/viewprofilepage/user-id/4446327)

Definitely doable. Make sure you include \\n\\n for each new line.

comments: author: milynnus
body: [@Matt Page](/t5/user/viewprofilepage/user-id/4446327)

For larger dataset, I would suggest using HTTP request to an endpoint. The {httpresponse} will be in key:value pair which you can use it to set the custom field values. You can extend your endpoint to handle the CF updates.

See [https://trello.com/c/ULsKwRLh/43-parse-card-description-for-key-value-pairs-simpl](https://trello.com/c/ULsKwRLh/43-parse-card-description-for-key-value-pairs-simple)

This is a sample output from Butler console for a more complex card description from a webform from Contalist. It shows the http request from Butler.

![Screen Shot 2021-06-23 at 7.49.05 AM.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/148506i85352DE62D6C245C/image-size/large?v=v2&px=999 "Screen Shot 2021-06-23 at 7.49.05 AM.jpg")


author: Matt Page
body: Thanks, that looks really helpful. I'm still very new to Trello, let alone doing more advanced stuff like this, but I also had a strong suspicion it was possible somehow.


author: milynnus
body: [@Matt Page](/t5/user/viewprofilepage/user-id/4446327)

It can be done with Butler. You just need to be very careful in building out the command. Here, I am relying more on the structure and using the names (keys like name, address, email etc) instead of hardcoding. It can be use for any card as long as the structure remains unchanged.


author: Iain Dooley
body: [@Matt Page](/t5/user/viewprofilepage/user-id/4446327) you can actually use regular expressions directly in Butler, can you post your existing rule that's working?

comments: author: Matt Page
body: [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) Sorry it's taken me so long to reply - I sort of forgot about the thread!  

So at the moment I have 6-7 rules along similar lines to:
> when a card with a description containing "\</\\\>\|\|??{\*}\<\\/\>\|\|??" is added to list "engine room", set custom field "Project or BAU" to "{wildcard1}"

But if I put another expression in there I can't get it to work. Ideally I'd be able to have just the one rule that found 6-7 expressions and sent them to 6-7 different rules. But as I say, my method is working, it's just a bit cumbersome.

Matt


Tags: custom-field

wildcard