Any way to change job variable?

Is there a way to change variable values in the orchestration job? Have duration from a task, but it is in milliseconds not seconds. Tried sql script but it does not let me use a SELECT ${variable} / 1000

Hi @rka1621004583744​, I am assuming you have a job variable with a default value that is some millisecond value but then you need to update the value to be the equivalent value in seconds. If that is correct, you can do this a couple different ways. One way would be to use a Python Script component.

The python script would look like the below. In the below example timeval is your job variable with the millisecond value.

import math:

val = int(timeval) / 1000

print(math.trunc(val))

context.updateVariable('timeval', str(val))

I hope this helps!

Hi. I'll try that. Never written python before, but might as well start learning that code language as well