To any poor souls that come to this thread in the future, I did figure out one way. If you're reading this, you may be an XSL noob like myself, but the trick is the
document() method within XSL. You can look it up if you want, it's weirdly documented in a lot of places, but basically you kind of need to have some grasp on the way that Templates and passing arguments works, re: XPATH. For this, I'll keep it super simple, because this is what I was looking for.
If you want custom data that isn't a statistic Marquee provides natively, eg the result of a SQL query or simply something you write to a file that you can change, create another XML file (separate from the one you're transforming with XSL) and for starters you should leave it on the same server Marquee is on, just so access isn't a problem. Use something basic, like
<?xml version="1.0"?>
<note>
<to>Universe</to>
<from>Evan</from>
<subject>leave me alone</subject>
<body>Have a good weekend!</body>
</note>
Once you place that file on the server, you need to point to it in the XSL. You see a lot of people using
xsl:copy-of
, but your boy is out here repping the simple life,
xsl:value-of
so let's look at that. I kept my file at the root of the E drive, so my statement looks like this:
<xsl:value-of select="document('file:///e:/test.xml')"/>
Let's assume we're already familiar with select statements. Inside of the document() method, note the forward slashes in the address there. If you don't know this already, you're looking at a
URI, the
absolute path to this file. Simply just fill in where you've put the file on the machine, and of course reverse the slashes. Related concept is
relative path so look that up if you're curious. The other part of this document() method is where the other argument would go, which is where the magic happens. Left as it is above, this statement will access the base node, meaning you'd get all of my XML content above:
"Universe Evan leave me alone Have a good weekend!". While we could conceivably parse this downstream, we probably want to do as much as we can within Marquee, so what does the node argument look like?
<xsl:value-of select="document('file:///e:/test.xml')/note/to"/>
The second argument
/note/to
would retrieve
Universe from my XML above.
<xsl:value-of select="document('file:///e:/test.xml')/note/to/from"/>
This would retrieve
Evan, and so on.
Take special care of the notation here. Depending on your template, you'll have to do more or less work to get this matching. The above assumes a basic template of
<xsl:template match="/">
so you just need the leading slashes in the second argument, as I have done.
Again, super basic and probably obvious to the real devs here, but I hope this someday helps another wayward analyst who, like me, screamed into the void of his own shortcomings and received naught but an echo. Feel free to reach out to me in DM or in this thread here with any questions on this. I will try to keep the torch burning for you.
In the meantime,
Genesys: it would be really great to give us babies an interface for custom statistics, or give us an out of the box way of adding custom data in the
ininStatKeys. Most people will just take your XML output and make their own thing, but this would be a lot simpler and wouldn't require development resources to maintain.
------------------------------
Evan Doherty
------------------------------
Original Message:
Sent: 01-30-2020 13:53
From: Evan Doherty
Subject: Marquee Custom fields from DB
Hey folks,
I've built up a responsive, customized version of the IC Business Manager's Dialer Overview using Marquee. I loop through the entirety of each node in the XML to populate a simple HTML table.
It ends up looking something like this:
I'm happy with what we've got, but one thing I can't work out from the documentation is how to represent custom fields. I'm pretty beginner level as far as XML goes, but I know you can do stuff in SQL with FOR XML, and then somehow retrieving that and putting it in the XSL for Marquee to consume. But I was wondering (hoping) that there was perhaps an out-of-the-box functionality already supported by Marquee for doing such a thing that would allow me to access an existing value in a known database.
My team doesn't really have a good avenue for creating stored procedures or new automated processes in the database itself, so essentially I'm looking to do this all on the Marquee server side. I could potentially build my own database and load it with the extra things I want Marquee to display, but I'm not really confident in my ability to build out the schemas for generating full tables based on a SQL expressions. I was hoping that there was a node in the ininStatKeys, like an existing supported statistic that I could use to dump stuff into, but I haven't seen anything like that.
I'm also open to Occam's Razor answers here; I'm sure I'm missing something obvious but I figured I would see if this community has solved such a problem before hollering in to the void of Stack Exchange.
Thanks in advance for any ideas!
#Integrations
#Reporting/Analytics
#InteractionMarquee
------------------------------
Evan Doherty
------------------------------