• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Issue with building an array from a cfhttp request result.

Explorer ,
Jan 26, 2015 Jan 26, 2015

Copy link to clipboard

Copied

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)>

<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?

TOPICS
Advanced techniques

Views

377

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2015 Jan 27, 2015

Copy link to clipboard

Copied

LATEST

What about the obvious? Namely,

<cfif value_from_getqueue IS NOT value_from_cfhttp_request>

<cfset arrayAppend()>

</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation