How to get approvers of a report while it is under processing (not approved yet)

Context: we are building a reminder bot that tracks any changes in status of reports.
Question: How can we get the list of approvers (who are supposed to approve the report) while the report is under processing?
Use Case: user A submits a report to user B. reportStatus is processing/submitted.
--> How can we get user B although B has not approved the report?
We tried looking at approvers but this only appears when report has been approved. We also looked at actionList with the hope that there should be info about who is the next user to take action but it doesn't work.
Best Answer
-
Ted Harris Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 359 Expensify Team
How's this @binhnguyendn1606:
<#if (addHeader == true)> Employee Email,<#t> Report ID,<#t> Report Name,<#t> Submitted Date,<#t> Amount,<#t> Status (Processing),<#t> Total number of Days Awaiting Approval,<#t> Current Approver,<#t> Number of Days Awaiting Current Approver<#lt> </#if> <#list reports as report> <#assign daysSinceSubmit = ""> <#assign daysToApproval = 0> <#assign lastApprovalDate = ""> <#assign submitted = ""> <#if (report.approvers?size > 0)> <#assign lastElement = (report.approvers?size - 1)> <#assign lastApprovalDate = report.approvers[lastElement].date?date("yyyy-MM-dd hh:mm:ss")!""> <#assign daysToApproval = ((.now?long - lastApprovalDate?long) / (1000 * 60 * 60 * 24))?int> </#if> <#if report.submitted?has_content> <#assign submitted = report.submitted?date("yyyy-MM-dd hh:mm:ss")> <#assign daysSinceSubmit = ((.now?long - submitted?long) / (1000 * 60 * 60 * 24))?int> </#if> <#if report.status == "Processing"> <#-- Employee Email -->${report.accountEmail},<#t> <#-- Report ID -->${report.reportID},<#t> <#-- Report Name -->${report.reportName},<#t> <#-- Submitted Date -->${report.submitted?date("yyyy-MM-dd")?string("yyyy-MM-dd")},<#t> <#-- Amount -->${(report.total/100)?string("0.00")},<#t> <#-- Status (Processing) -->${report.status},<#t> <#-- Total number of Days Awaiting Approval -->${daysSinceSubmit},<#t> <#-- Current Approver -->${report.managerEmail},<#t> <#-- Number of Days Awaiting Current Approver -->${daysToApproval}<#lt> </#if> </#list>
This should help you towards your goal I hope! The main piece you're looking for is:
${report.managerEmail}
though!
Answers
-
Thank you @Ted Harris, this works perfectly.
Just one note: the clarification of
managerEmail
as "The email address of the last approver of the report"
is quite confusing. Anway, this helps a lot. -
Victoria O'leary Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 110 Expensify Team
Thanks for the feedback @binhnguyendn1606
So I can make sure this is more clear for the next user, can you please send me the link to the page where you saw "the email address of the last approver of the report" referenced?
Cheers!
-
@Victoria O'leary Here it is: https://integrations.expensify.com/Integration-Server/doc/export_report_template.html
it looks confusing to me.
By the way, can I ask what is the difference between the Object Reference in these two links:
and
-
Matt Moore Expensify Customer, Expensify Success Coach - Admin, Expensify Team Posts: 132 Expensify Team
Thanks @binhnguyendn1606, that's helpful! I'll pass the feedback on.
On your second question, please could you be more specific?