Thanks a lot, this was really helpful. I needed to have loops as for some point based on some loop conditions, I have to disconnect the call with a message. So I restructured the flow to remove all loops and instead put a variable that will be incremented in each step as a workaround for the loop.
Original Message:
Sent: 11-04-2023 20:07
From: Jan Heinonen
Subject: Position in queue variable not updating
Hi Ahmed,
The In-Queue flow is an "infinite" loop in itself, so by doing the below it would play hold music for 15 seconds, the play queue position and repeat from the top.

I only use Loops if I need to repeat something several times within the flow before moving forward, mainly when going through arrays of data.
The goal should always be to get to the bottom and start over since Loop has limited times it can be repeated.
I did test the "Play position in queue" functions and that does seem to update within a Loop, although I still think Loop should only be used when necessary.
------------------------------
Jan Heinonen
Contact Center Specialist
GlobalConnect AB
Original Message:
Sent: 11-04-2023 18:19
From: Ahmed Zein
Subject: Position in queue variable not updating
Hi Jan,
That's a really good point, but my business needs is to be in a loop so that customer keeps looping for hold music and some messages and hear his position in queue. So any workaround can be done in this case?
I wonder how the standard action "Play position in queue" keeps updating it.
------------------------------
Ahmed Zein
Original Message:
Sent: 11-04-2023 18:08
From: Jan Heinonen
Subject: Position in queue variable not updating
Hello,
I did some testing and indeed it doesn't update if it's in a loop like this

If you don't have a loop it works as intended, I'm guessing this is because the variables get reloaded when the script starts from the top again.
To solve the issue the question is if you need the loop or if you can design it in a way that makes it run through complete flow between each message with queue position?
------------------------------
Jan Heinonen
Contact Center Specialist
GlobalConnect AB
Original Message:
Sent: 11-02-2023 14:10
From: Ahmed Zein
Subject: Position in queue variable not updating
Hello,
I have a need to use Call.PositionInQueue variable without using the standard action Play position in queue. So whenever I use this variable in a loop it never gets decreased but stays as it is. For example, there are 2 calls waiting on the queue and second call Call.PositionInQueue=2 then when first call hangs up, second call Call.PositionInQueue value is still 2 and not updated to be 1 even after sometime.
So anyone has an idea why this is happening or how to fix it?
#ArchitectureandDesign
------------------------------
Ahmed Zein
------------------------------