banno-digital-toolkit

Banno - Report Export Retrieval - Retrieve Most Recent Report ID


I am attempting to utilize the Report Exports functionality with the Provider Banno API to load report data from Banno to SQL utilizing jhaEnterprise Workflow. I am needing to retrieve the most recent id for the type Conversations_AllConversations, but no matter what I do it will only return the first id for that report type. Is there any way to filter on the URL itself or does this API not support query parameters? I will have to use the Response XSL if that is the case and nothing I have tried there has been successful.

The most recent attempt I made had the following as the response XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                version="1.0">
    <xsl:template match="/">
        <WorkflowTranslatedResponse>
            <VariableMap>
                <ActivityMapVariable>
                    <VariableName>sReportId</VariableName>
                    <Value>
                        <xsl:value-of select="root/data[type[last()] = 'Conversations_AllConversations']/id"/>|
                    </Value>
                </ActivityMapVariable>
            </VariableMap>
        </WorkflowTranslatedResponse>
    </xsl:template>
</xsl:stylesheet>

This still only returned the FIRST id result from the API response. Does anyone have any pointers on how they may have utilized this on their side or do we need to look elsewhere? Right now a user is having to manually pull the reports from Banno and use a transform to upload the data to SQL.


Solution

  • I was able to utilize this XSL to get the response information:

        <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                    version="1.0">
        <xsl:template match="/">
            <WorkflowTranslatedResponse>
                <VariableMap>
                    <ActivityMapVariable>
                        <VariableName>sReportId</VariableName>
                        <Value>
                            <xsl:choose>
                                <!-- Check if there is any data element matching the condition -->
                                <xsl:when test="//data[type='Conversations_AllConversations']">
                                    <!-- Get the id of the last occurrence -->
                                    <xsl:value-of select="//data[type='Conversations_AllConversations'][last()]/id"/>
                                </xsl:when>
                                <!-- If no matching data element is found, output some default value or message -->
                                <xsl:otherwise>
                                    <xsl:text>No matching data found</xsl:text>
                                </xsl:otherwise>
                            </xsl:choose>
                        </Value>
                    </ActivityMapVariable>
                </VariableMap>
            </WorkflowTranslatedResponse>
        </xsl:template>
    </xsl:stylesheet>