Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Target Gravity Forms Comment Regex

Kelsey Greer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 13, 2025

Hi Atlassian community,

I'm hoping someone can help me find the correct regex to target Gravity Forms values in a comment on Trello.

Basically, I am using a Powerup called Sendboard to send Gravity Forms notifications emails to my board. The email is posted as comment on the card and my goal is to create an automation that extracts the form values and add them to custom fields.

Here is an example of an email that I receive when a Gravity Form is submitted:

Screenshot 2025-03-13 at 9.38.36 AM copy.png

Here is an example of the regex I'm trying to use that does not work:

Screenshot 2025-03-13 at 9.44.18 AM.png

I think the issue is related to the fact that there are line breaks involved. I know that Trello uses markdown so I tried many variations using \n\n to account for the line breaks but I cannot seem to get it to work... 

Also, here is what the code looks like on the board in case that helps:

Screenshot 2025-03-13 at 9.48.32 AM.png

 

Any help on this would be greatly, greatly appreciated!

1 answer

0 votes
Wandile Shezi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 14, 2025

Hi Kelsey

Here's a butler rule that uses regex to extract 6 different values from incoming emails. You can use this rule exactly as-is to test the output of all 6 wildcards.

regex:/\📩\s\[Email\]\((.*)\) From \*\*(.*?(?=[<]))?<?(.*?(?=[>\*]))>?\*\*[\s\\n\\r]*(?:.*?(?=[\[]))?\[?(.*?(?=\]))?\]?(?:.*?)?[\s\\n\\r]*------[\s\\n\\r]*([\s\S]*?)[\s\\n\\r]*------[\s\\n\\r]*To: (.*)/

Please let me know if there is anything else I can help with.

Kelsey Greer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2025

Hey Wandile,

Thanks for the response. It seems like the regex you provided is basically the same as the regex in this Sendboard article: 

Save email details to Trello Custom Fields

Essentially I think it follows the same pattern as the regex mentioned in the article:

📩 [Email]({*}) From **{*}<{*}>**{*}------{*}------{*}To: {*}

My goal is to be able to target individual items within the body of the Sendboard email, not just return the entire email body with a wildcard. For instance, I'm using the following regex to target the same content from the email body in the card description:

regex:/Property Address: (.*?)\nAre you the Owner\?: (.*?)(?:\n|$)/

I've tried countless regex variations to target the content in the email body but it seems like the dividers in the email are causing the issue. The typical line break notation (\n\n) does not work.

Any help on targeting individual items within the body of the Sendboard email would be greatly appreciated!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events