This content has been marked as final. Show 6 replies
So what is your question ? (ie Which part are you having difficulty with)
My problem is the "return" after each set of data. I can only get the first 2 pieces of data in this case Kelly Wadell and Transferred from POU .
my tempVar3, which should be the date is either empty if I set the delimeter to try and find the "return" ( used &ch13; and \n ) or I get the date and the name of the next person.
How do i get the 3 pieces of information into something that can be output to a table with each piece in its own column?
Thanks, the first post the mind was moving faster than the hands.
Treat the value as nested lists. Loop through it using return ( chr(13) and/or chr(10) as the row delimiter. That will split the data into rows. Then split each row into columns using "|" as the delimiter.
If you are using CF8, I would recommend using arrays instead of list functions. The listToArray(..) function now supports empty elements. So your script will not break if one of the values is omitted.
<cfloop list="#response#" index="row" delimiters="...">
<cfset cols = listToArray(row, "|", true)>
... do something with the values here ...
I got it.
<cfif (getQ599Response.question_id EQ 911 OR question_id EQ 1282 ) and isDefined('response')>
<CFSET rep = #response#>
<cfloop list="#rep#" index="i" delimiters="#chr(13)#">
<cfloop list="#i#" index="j" delimiters="|"><td>#j#</td></cfloop>
Good. Keep in mind your script may break/display incorrectly if there are empty values. List functions do not handle empty elements well.
> <CFSET rep = #response#>
BTW, the separate variable is not needed. Just use the #response# variable.
If you have the opportunity, you should alter that table so that each list element of the response is in it's own field.