API Report Exporter

Hello,
I am using Postman to write calls to the Expensify API Report Exporter. Does anyone know how to get the credit card transaction posting date in the report export templates using the Expensify API? You can create a CSV custom export to include the credit card transaction posting date by using {expense:posted}, but if you use the same field name with the Freemarker language ${expense.posted}<#t> then the results are null. I have 15 different domains for the same company, and I need a report that can include all of the transactions for all 15 domains. I understand that ${expense.posted}<#t> will work for the reconciliation export, but the reconciliation export REQUIRES ONE domain address as a filter which means I cannot pull data for all 15 domains without changing the variable 15 times or using a collection runner. I do not want to use a collection runner because the company acquires about 30 new locations (with new domains) every year and I can't add maintenance time right now.
Any help would be greatly appreciated! Please post a reply! Thank you!
Best Answer
-
Hi @Mikail, here's how I've seen others do it in their Freemarker templates:
<#if expense.details.posted?has_content && expense.managedCard> <#assign postedDate = expense.details.posted?date("yyyyMMdd")?string("yyyy-MM-dd")> <#else> <#assign postedDate = "Not Applicable"> </#if>
Then just print
${postedDate}
and this should work across all reports you export that have company card transactions on.
Answers
-
Christina Dobryzynski Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 270 Expensify Team
Hi there @Mikail! We'll keep your question open for someone in the community to jump in and help. I'm unfamiliar with API setups, but I also reached out to some teammates to see if they might have a suggestion.
-
Thank you, @Christina Dobryzynski!!
-
@Ted Harris - This is exactly what I needed - worked great! Thank you!! Any chance you could share your knowledge on another open post of mine?