How to convert variable from config file to integer and time span(00:01:00)


I am getting error “Operation strict on disallows implicit conversion from string to integer”

HI @happyfeat87

Can you ping the expression to me?

I checked it on my side and it is working fine check below expression.

Convert.ToInt32(Config("Retry").ToString.Trim)

for timespan check below post:

1 Like

try integer.parse(Config("Retry").toString)
and what is the value of your Config("Retry").toString ?? make sure its a number

1 Like

@jack.chan
Its 4.
I’m still getting the error “Operation strict on disallows implicit conversion from string to integer”
Thank you

Can you please restart your studio and try? @happyfeat87

I tried your expressing Convert.ToInt32(Config(“Retry”).ToString.Trim)

.But still getting the same error.

This is how I prepared config.
image

whats the type of you config

is it Dictionary(string,object)?

Yes. That’s correct.

dont put Convert.ToInt32(Config("Retry").ToString.Trim) as a default value , use it in assign activity and see if it works


image

1 Like

Thank you @jack.chan .
All your solutions worked. But I missed changing the variable type to Dictionary(string,object).

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.