Is there a way to filter by two different exported names via API?

Is there a way to filter by two different exported names via API?
According to the API, markedAsExported filter does:
Filters out reports that have already been exported with that label out.
I want to filter out 2 labels.
Best Answer
-
Hi @edison! The "label" in this context is that it has been exported. We don't support filtering on multiple export names. As a workaround, you can do the filtering in the template itself using something like:
report.allExportsLabels?seq_contains("ABCD")>
.Hope that helps!
Answers
-
Thanks Nicole for the workaround! I'll try it out.
-
Hi @Nicole Mendonca - I tried using
report.allExportsLabels
(without any filters) and it's not pulling up any data. Wondering if that's the correct name? -
Hi @edison - Did you include a template name? Can you post here exactly what you included? What are the "exported names" you want to filter by?
Thanks!
-
Hi @Nicole Mendonca see info below:
requestJobDescription =
{ "type":"file", "credentials":{ "partnerUserID":"_userid", "partnerUserSecret":"_usersecret" }, "onReceive":{ "immediateResponse":["returnRandomFileName"] }, "inputSettings":{ "type":"combinedReportData", "reportState":"APPROVED,REIMBURSED", "filters":{ "startDate":"2020-01-01", "approvedAfter":"2020-03-31", "reportIDList":"_reportID" } }, "outputSettings":{ "fileExtension":"csv", "fileBasename":"myExport" }, }
template =
<#if addHeader == true> report.allExportsLabels,report.reportID </#if> <#list reports as report> <#list report.transactionList as expense> ${report.allExportsLabels},<#t> ${report.reportID}<#t> </#list> </#list>
Based on the above, I'm currently not using any filters in the
requestJobDescription
for exported, nor am I using anseq
in the freemarker template. I would expect there to be some data though for the report.allExportsLabels field. -
Hi @edison,
report.allExportsLabels
is a list of all the export labels that are applied to the report, to make it easier to filter the reports directly in the template, like this:<#if report.allExportsLabels?seq_contains("YOUR_LABEL")> report was previously exported <#else> report wasn't exported yet </#if>
If you want to output all the export labels for a report, you'll need to convert the list to a string first, for example like this:
<#list reports as report> ${report.reportID},<#t> ${report.allExportsLabels?join("-")}<#lt> </#list>
Cheers
-
Ah that did it. Didn't know how those labels were stored. Thanks @Francois Laithier !