aionin
Novice

How to convert text to int?

How do I get just the number out of a text variable? I am getting {"Id":25,"ID":25} out of the text variable, and I just need the 25.

When I try to use "Convert Value" to go from text to a number variable, I am getting "Input string was not in a correct format." error.

0 Kudos
Reply
4 Replies
TomaszPoszytek

Re: How to convert text to int?

It seems to be some sort of a collection. So what you should do is to use "Get element from collection" action and then configure it to retrieve element with the index=0. You can then save it to the variable that is a "number" type.

Regards,

Tomasz

0 Kudos
Reply
aionin
Novice

Re: How to convert text to int?

When I do that, I get "Data type returned from the collection is incompatible with the output variable to store the result in."

0 Kudos
Reply
TomaszPoszytek

Re: How to convert text to int?

Then use a text variable, after the action log to the history what is the value of that variable and if needed (and if you are sure this is an integer indeed), you can then use "convert" action.

Regards,

Tomasz

Reply
milan_chaloupka

Re: How to convert text to int?

Hi,

maybe before loop of the collection remove all empty elements from collection.

Or when you use foreach loop, are you able to log all elements from collection to WF history?

0 Kudos
Reply