1 Reply Latest reply on Jan 27, 2015 6:16 AM by BKBK

    Issue with building an array from a cfhttp request result.

    siriiven Level 1

      Here is what I am trying to do. Retrieve a bunch of results from a  REST request. Run a query to see if I should be excluding any of the xmltext entries coming back from the rest request. Build an array of the REST xmltext entries except the entries in the cfquery.

       

      I have it all workign except building the array minus the entries that came back in the cfquery. Here is my code so far.

       

      <cfquery name="getqueue" datasource="#application.settings.dsn#">

      select * from friends

      where Deactivatedate < #DATEADD('d', 1, CreateODBCDateTime(now()))#

      </cfquery>

      <cfoutput query = "getqueue">

      <cfhttp  blah blah>

      <cfset nodes_parse = XmlParse(CFHTTP.FileContent)>

      <cfset Nodes = xmlSearch(nodes_parse,'friends/friend/date/activedate/')>

       

       

      <cfset roleArray = ArrayNew(1)>

      <cfloop from="1" to="#arraylen(Nodes)#" index="i">

        

         <cfset NodeXML = xmlparse(Nodes[i])>

      <cfset ArrayAppend(roleArray, '[sel_members][]=#NodeXML.activedate.xmlText#&')>

       

      </cfloop>

       

      </cfoutput>

       

      My issue is down in the loop where I do the arrayappend. How would I build an array of values coming back from the cfhttp request but not include any of them if they match up with anything coming back from the getqueue query?