Looping Through QueryResult From Database

Discussion in 'Call Flow Designer' started by Mwamba, Jan 12, 2018.

Thread Status:
Not open for further replies.
  1. Mwamba

    Joined:
    Sep 20, 2017
    Messages:
    23
    Likes Received:
    1
    I have tried modifying the Predictive Dialer example to dial multiple numbers in the database.
    upload_2018-1-12_15-51-0.png

    As you can see from the example above I am initializing the index to 0 in the first Variable Assignment box.
    In the second Variable Assignment box I create a variable that stores the length of the QueryResult.
    In the Increment VariableBox, I increment the index variable
    There is a bug in my application that I am unable to fix, the application only dials the first number in the QueryResult and does so continously. It does not dial the other numbers. Can someone show me an example of how to use the for loop, I did not find one when searching online.
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,150
    Likes Received:
    86
    Hello @Mwamba,

    How are you getting the number to call from the QueryResult table? You need to use the CFD Function "GET_TABLE_CELL_VALUE" as follows:
    GET_TABLE_CELL_VALUE(getNextNumber.QueryResult,callflow$.Index,0)

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Mwamba

    Joined:
    Sep 20, 2017
    Messages:
    23
    Likes Received:
    1
    Yes I am, however I am using project variables as follows,
    GET_TABLE_CELL_VALUE(getNextNumber.QueryResult,project$.Index,0)
    However the index does not increment
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,150
    Likes Received:
    86
    Can you add a Logger component to log the values of the variables? Then check these logs from the 3CX Queue Manager log file.

    In the log you will also see the database query result, so you can also check if the rows have the value they should have, or they all have the same numbers...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Mwamba

    Joined:
    Sep 20, 2017
    Messages:
    23
    Likes Received:
    1
    Ok, thanks I will
     
Thread Status:
Not open for further replies.