The Architect Expressions can't be used within a script. You would need to use a Dynamic variable like you are doing and work out a formula to use. For instance if you wanted to work out hours, mins and seconds from an integer value that contained seconds you would need to follow a few steps and it might take a few different variables to do it.
Let's say you had 8,274 seconds.First, find the number of whole hours8,274 seconds = 8,274 seconds Ă· 3,6008,274 seconds = 2.29833 hoursfull hours = 2Find the number of whole minutesminutes = .29833 hours Ă— 60 minutesminutes = 17.9 minutesfull minutes = 17Find the remaining secondsseconds = .9 minutes Ă— 60 secondsseconds = 54 secondsFinish up by rewriting as HH:MM:SStime = 2:17:54If we put this same method onto your example of 90 seconds we would get:
90 / 3600 = 0.025 (zero hours)
0.025 (the decimal portion of the above result) * 60 = 1.5 (1 minute)
0.5 (the decimal portion of the above result) *60 = 30 (seconds)
So you would always take the integer part of the result as the time (hours, mins or secs) and use the decimal part on the next calculation.
Using a Dynamic Variable, or a few dynamic variables this should be possible.
Let me know if this doesn't make sense or you run into problems.
------------------------------
Craig Stevenson
Genesys - Employees
------------------------------
Original Message:
Sent: 01-27-2021 07:00
From: Jeremy Monzo
Subject: Convert second in minute seconde
Hi Craig,
Thanks for your feedback.
In fact, the calculation of estimated wait time is executed in the script and not in the Architect flow, like this I can be most precise regarding the estimated waiting time metric. Could I reuse the function ToString(MakeDuration(0,0,0,90)) or something equivalent in the script?
BR
jeremy
------------------------------
Jeremy
Original Message:
Sent: 01-27-2021 06:49
From: Craig Stevenson
Subject: Convert second in minute seconde
Hi Jeremy,
If you are using Architect to set the Script that is popping you could set the variable for the script in Architect.
Use the MakeDuration(Day,Hour,Min,Second) to convert your integer to a time. Because I was using a String variable in my script I used ToString(MakeDuration(0,0,0,90)). You would replace "90" with the variable you have containing the integer (value in seconds) to a time.
When I pop the script I get the value coming through as PT1M30S, but you could use other String functions to split this down to properly display.
Hope that helps,
------------------------------
Craig Stevenson
Genesys - Employees
Original Message:
Sent: 01-26-2021 05:44
From: Jeremy Monzo
Subject: Convert second in minute seconde
Hello,
I retrieve in a script a integer variable which contain a number of second (Ex :90).
I would like convert this number of second in different format (Ex: MM:SS, it means 1:30).
I have used dynamic variableand function from math.js.
I found the formula mod(90/60) which returns 30, But now I would like retrieve the integer part, it means 1 minute ( I found the formula round but it deosn't fit my requirement), we can use also the fucntion substr for retrieve the first caracter but it seems complex for my basic requirement.
What is the simple way to achieve my requirement without create many different variable?
thanks for your hints
thanks
jeremy
#ArchitectureandDesign
#Unsure/Other
------------------------------
Jeremy
------------------------------