I was wondering how you can export a report and email it that shows custom fields and its values.
Asked by Evan Venieris:

I am trying to create either a button or a weekly report that will show the name of the card, the people that are working on the card , the list its in and the value from a specific custom field (number)

I know how to show everything except the value from the custom field.

Customer support informed me that the variables {customfieldvalue},{customfieldname} do not work in the report.

Hence i started exploring the response option. However I dont know how to call the specific information from the json file generated, so when the email is received it show "

(INVALID_JSON Fee:INVALID_JSON})\]"

The command I use is"

put to url "[https://trello.com/x/xxx/team-xxx/exports?key={x-x-x-x-x-x}\&token={x-x-x-x-x-x-x](https://trello.com/x/xxx/team-xxx/exports?key={x-x-x-x-x-x}&token={x-x-x-x-x-x-x)} - -data 'attachments=true'" with payload "Payload", create a report in variable "CF" with all cards with custom field "Contractor Fees (?)" set to a number greater than 1 using pattern "\[{cardname}\]({cardlink}) ({cardmemberusernames}) - ({httpresponse}\\n Fee:{httpresponse.{customfieldvalue}})\]" group by due date, and send an email notification to "blabla@blabla.com" with subject "Contractor fees report" and message "\\"Hello,\\nPlease find the list with the outsourced projects and their fees below:\\n\\n{$CF}\\n\\nThank you

"


Answers:
author: Felix
body: Hi [@Evan Venieris](/t5/user/viewprofilepage/user-id/4971566)

I think you're over-complicating the report command. I don't think you need to use the Export API, and I'm pretty sure it won't work this way, because exports are asynchronous and can take many minutes to complete. They also produce an archive of board data, not a plain JSON response. There's also no PUT on "/exports" :)

Here's the command, creating the report you are describing:

```
create a report in variable "CF" with all cards with custom field "Contractor Fees (?)" set to a number greater than 1 using pattern "[{cardname}]({cardlink}) ({cardmemberusernames}) - Fee: {{%Contractor Fees (?)}}", and send an email notification to "email@example.com" with subject "Report!" and message "Hello,\nPlease find the list with the outsourced projects and their fees below:\n\n{$CF}\n\nThank you"
```

Note that to access the custom field value, you need to specify it slightly differently to other variables, as "{{%Contractor Fees (?)}}" in this case (the name wrapped in "{{%" and "}}"). This is documented here: <https://support.atlassian.com/trello/docs/working-with-custom-fields/#custom-field-variables>

The command above generates a report like this:

![Screen Shot 2022-06-22 at 9.20.28 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/202938iED8F5C778390E600/image-size/large?v=v2&px=999 "Screen Shot 2022-06-22 at 9.20.28 AM.png")

comments: author: Evan Venieris
body: Felix! you are a STAR! thank you so much for the answer.

It is exactly what i needed.

Indeed i overcomplicated it and i think i got confused because i should have created the report a bit differently and not format the email as i did.

Again huge thanks for your help.

Evan