epipko
04/22/2022, 3:43 PM<cfset jsonData = deserializeJSON(httpResp.fileContent) />
<cfset return_line_items = jsonData.included>
<cfloop array=#return_line_items# index="i">
<cfset line_item_id = #i.id#>
<cfset line_item_type = #i.type#>
<cfoutput>
Line_item_id: #line_item_id#<br />
Line_item_type: #line_item_type#<br />
</cfoutput>
<br />
</cfloop>
, but when I try to get to carrier this way, I am receiving the error: "Invalid collection .... Must be a valid structure or COM object."
<cfif #i.type# EQ "shipping_labels">
<cfloop collection="#jsonData.included#" item="k">
<cfset carrier = #jsonData.included.attributes.[k].carrier#>
<cfoutput>#carrier#<br /></cfoutput>
</cfloop>
</cfif>
aliaspooryorik
aliaspooryorik
#
in your if statements. So this <cfif #i.type# EQ "shipping_labels">
is the same as <cfif i.type EQ "shipping_labels">
Daniel Mejia
04/22/2022, 3:56 PMaliaspooryorik
jsonData.included
<- this is an array
jsonData.included.attributes
<- this breaks as included
is an array and you are trying to reference a key, rather than the index.aliaspooryorik
Daniel Mejia
04/22/2022, 4:01 PMepipko
04/22/2022, 4:15 PMaliaspooryorik
epipko
04/22/2022, 4:20 PMaliaspooryorik
epipko
04/22/2022, 4:24 PMDaniel Mejia
04/22/2022, 4:25 PMjakobward
04/24/2022, 2:13 AM