AnsweredAssumed Answered

Finesse Gadgets parsing user ID in xml

Question asked by on Sep 7, 2016
Latest reply on Sep 7, 2016 by dekwan

So I'm trying to replicate the agent call logs from CAD.  I'm using the SampleGadget as a starting point.  I just want to be able to check (with an if statement) the user ID and show THAT agent's CDR for the day via CUIC.  I'm wanting to do this in the javascript section of the XML page (what I've changed is in red):

     <body class="claro">
                <!-- Sample Gadget -->
                    <fieldset id="userfieldset" class="outline">
                        <div><b> User ID: </b><span id="userId"></span></div>
                        <div><b> First Name: </b><span id="firstName"></div>
                        <div><b> Last Name: </b><span id="lastName"></div>
                        <div><b> Role: </b><span id="userRole"></div>
                        <div><b> Extension: </b><span id="extension"></div>
                        <div><b> Current User State: </b><span id="userState"></div>
                        <div id="goReady">
                            <button onClick="finesse.modules.SampleGadget.setUserState('READY');">Change state to READY</button>
                        <div id="goNotReady">
                            <button onClick="finesse.modules.SampleGadget.setUserState('NOT_READY');">Change state to NOT READY</button>
                        <div id="makeCallButton">
                            <input type="text" id="phoneId" value="6100"></input>
                            <button onClick="finesse.modules.SampleGadget.makeCall(($('#phoneId')).val());">Make Call</button>


                    <fieldset id="dialogfieldset" class="outline">
                        <div><b> Call Id: </b><span id="callId"></div>
                        <div><b> Call Type: </b><span id="callType"></div>
                        <div><b> DNIS: </b><span id="dnis"></div>
                        <div><b> From Address: </b><span id="fromAddress"></div>
                        <div><b> To Address: </b><span id="toAddress"></div>
                        <div><b> Call State: </b><span id="callState"></div>
                        <iframe name="userreport" id="report" width="900" height="300" src=""></iframe>



            <script type="text/javascript">
                gadgets.HubSettings.onConnect = function () {
                   if (userId == "6670"){

User Id is displayed no problem using HTML.  Anyone know how to reference the userId in the javascript section?