Convert String to Int

Hi,

I have propert_type= text and i want to store that value to some other property , which is Integer.

i am getting this error at run time

pyID	.pegaToInteger()	Invalid number format (was 2022012000012_AssetVal0000008)

Do pega has any function by which we can convert text to int.

Regards

Aditi

@ADITIJ49

As per your understanding, what would be the integer equivalent of string 2022012000012_AssetVal0000008?

Thanks

@Nirmalya.SenSharma

I have 1 property which is of type text and it has some value. Now I want to save the value into another property which of integer.

How to do that

Eg:in activity I have to do

Property set

Abc= xyz

Abc is integer property

Xyz is text

Regards

Aditi

Hi @ADITIJ49, since text to int direct conversion is not possible, I was wondering if you want only digits from your text and store it in a integer property? If yes, try using this:

@pxReplaceAllViaRegex(.YourProperty,“[^0-9]”,“”)

If you pass “2022012000012_AssetVal0000008” to the above RegEx you will get “20220120000120000008”.

Hope this is what you are looking for!

Thanks,

Saurabh.

@SaurabhG7134

Thanks Saurabh, i will check on this.

Regards

ADiti