Questions tagged [cfloop]

CFLoop: ColdFusion Loop This is a conditional loop. A conditional loop iterates over a set of instructions as long as a condition is True. To use this type of loop correctly, the instructions must change the condition every time the loop iterates, until the condition is False. Conditional loops are known as WHILE loops, as in, "loop WHILE this condition is true."

<cfloop> is a ColdFusion tag that is used to iterate over data. It supports five different types of loops:

  1. Index Loops
  2. Condition Loops
  3. Looping over a Query
  4. Looping over a List
  5. Looping over a Structure

Read more about the different kinds of loops here

145 questions
3
votes
1 answer

insert into table by looping over structure

I am trying to insert into the code but it is inserting value in every row, rather than question value in question and answer value in answer:
Visual
  • 33
  • 2
3
votes
0 answers

ColdFusion Looping Around Times to find the date

Default schedule for Steve Employee is Monday - Friday from 6:00 PM to 2:00 AM. startdate = 10/14/2018 starttime = 6:00 PM endtime = 2:00 AM (the next day) When I generate the schedule in ColdFusion, it loops through each date where DayofWeek is…
Bobmd
  • 125
  • 7
3
votes
3 answers

Best way to store permissions for the user account?

I have permission records that are tied to each account in my application. Each account can have one or multiple permission records based on account type. Here is example: SELECT…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
3
votes
3 answers

Getting values from multiple structs and arrays using Coldfusion

I have an api call that gets survey results from a 3rd party. I then DeserializeJSON the result and it looks like this (n.b structs within the questionResults have been minimised for space): I then loop through the first level and can pull the…
Sam Allen
  • 589
  • 4
  • 6
  • 16
3
votes
1 answer

Using ColdFusion (2016) to loop over spreadsheet data and group the output

I apologize in advance for the length of my question! I am trying to automate building a schedule of papers for our event. Paper and author data is provided in a spreadsheet (which my poor colleague currently uses to manually cut and paste, line by…
daltec
  • 447
  • 1
  • 5
  • 15
3
votes
2 answers

Using column names from dynamically named variables in Coldfusion

I want to create a function that will loop through an arbitrary query and perform an insert into another table based on the arbitrary column names. For instance, the idea here would be to output (data, data, data...) (data, data,…
abalter
  • 9,663
  • 17
  • 90
  • 145
2
votes
4 answers

is causing the weirdest error

I have been having the hardest time trying to resolve the weirdest error when any kind of condition is used within any kind of loop. The error I keep getting is: "Complex object types cannot be converted to simple values." on the line that contains…
Salsero69
  • 2,160
  • 3
  • 23
  • 27
2
votes
1 answer

Lucee/Adobe ColdFusion - Setting/getting information from thread{}

I'm working on creating a simple email server status page that calls two different CFCs. The status page requirements: Query a MariaDB database table via a CFC and return data from two fields: server_name (ie. MyServerName) & server_domain (ie.…
Grimdari
  • 353
  • 1
  • 16
2
votes
3 answers

cfdirectory output different html based on filter

I want to spit out slightly different html based on a filter condition passed to cfdirectory. Here is my cfml:
lharby
  • 3,057
  • 5
  • 24
  • 56
2
votes
2 answers

Coldfusion cfloop Sql queries extremely slow

I have list of quizzes that users take and table that keep tracks of number of questions they got right, quiz category, score and id for the quiz. In coldfusion, there is a cfloop that goes through each of the quiz and on the fly calculates the…
tamilgirl
  • 59
  • 1
  • 6
2
votes
2 answers

Coldfusion parsing cfhttp.filecontent into list

I am trying to parse through a cfhttp.filecontent that is returned and evaluate each variable. Here is an example of what is being returned: {"multicast_id":6110507831830919692, "success":0, "failure":1, "canonical_ids":0, …
Scott
  • 459
  • 2
  • 10
2
votes
2 answers

Loop over array of structures and output specific struct value?

I have array of structures where I should access specific field. Here is example of my data: array 1 struct address_city Washington address_state DC array 2 struct address_city New York address_state NY array 3 …
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
2
votes
2 answers

ColdFusion - Generate Random Text(ID) Answer List

I'm trying to create random test answers. Using a unique ID (Text) - Below randomizes the list only once when I use it. If I reload page it doesn't randomize again. Also - if it is a True False Answer of only 2 choices. It doesn't work. Any thoughts…
Merle_the_Pearl
  • 1,391
  • 3
  • 18
  • 25
2
votes
1 answer

Coldfusion Charting Multiple Series from QoQ

I am trying to insert a chart in an email that will graph multiple series' data over time. The email works fine, the chart attaches successfully but something is wrong with how I am generating the chart. What I am attempting to do: Loop through the…
sonoflars
  • 35
  • 5
2
votes
2 answers

Coldfusion Complex Construct

I am trying to construct a coldfusion conditional statement that looks for incremental form ID checkboxes to have been selected. All checkboxes are defined as Component[component number]. I have established a loop that is looking for a URL…
1
2
3
9 10