We are currently experiencing higher than normal support inquiries and response times. The Community is here to support you as well so please help each other out when you can. Please visit our status page to subscribe to updates.

Meaning of "expense.transactionID" in export_report_template

GetawayHouseGetawayHouse Posts: 6Expensify Customer
edited October 10 in Integrations and API


I'm trying to get a list of expenses reported, using the api with { type: 'file' } 

 json = {
   type: 'file',
   credentials: {
    partnerUserID: ENV['GETAWAY_EXPENSIFY_PARTNER_USER_ID'],
    partnerUserSecret: ENV['GETAWAY_EXPENSIFY_PARTNER_USER_SECRET']
   },
   onReceive: {
    immediateResponse: ["returnRandomFileName"]
   },
   inputSettings: {
    filters: {
     startDate: self.month.beginning_of_month.strftime('%Y-%m-%d'),
     endDate: self.month.end_of_month.strftime('%Y-%m-%d'),
     reportState: ["OPEN", "SUBMITTED", "APPROVED", "REIMBURSED", "ARCHIVED"]
    },
    type: 'combinedReportData',
   },
   outputSettings: {
    fileExtension: 'csv'
   },
  }

And my template looks like:

<#if addHeader == true>
  Amount,Sales date,Tag,Category,Comment,Report status,External ID,Name,Email<#lt>
</#if>
<#list reports as report>
  <#-- Report level -->
  <#list report.transactionList as expense>
    <#if expense.modifiedAmount?has_content>
      <#assign amount = expense.modifiedAmount/100>
    <#else>
      <#assign amount = expense.amount/100>
    </#if>
    <#if expense.modifiedCreated?has_content>
      <#assign created = expense.modifiedCreated>
    <#else>
      <#assign created = expense.created>
    </#if>
${amount},${created},${expense.tag},${expense.category},"${expense.comment?replace("\"", "'")}",${report.status},${expense.transactionID},${report.submitter.fullName},${expense.attendees.get(0).displayName}
  </#list>
</#list>

The problem is: I'm getting repeated ids for this field, for example: For the id 35387923473891400 I have 21 expenses with different values and comments, shouldn't every expense have it's own unique id? If I go to the dashboard, I can find a report with those 21 expenses...

If expense.transactionID isn't unique for each expense, is there a field that is?

Answers

Sign In or Register to comment.