cancel
Showing results for 
Search instead for 
Did you mean: 

Regex to replace brackets

KaranBhagwani1
Level 3
Decipher reads value from a field which is a monetary value and can be negative sometimes. For whatever reason, money datatype had a low confidence level so I am using Text datatype and it is reading accurately with full confidence. 
Example of value: (15) reads off as {(15)
Exclude values removes "{" and ")"
Value remaining: (15
At this point I am using Regex, If the value has "(", then replace it with "-"

However, the documents gets stopped at Data verification stage with red flag on this field. Error message is "The Value is not equal to -15 in the formula". 
The Value auto-populated is (15)
Expression: IF(EQ(STRCONTAINS(Field_Id,"("),1), STRREPLACE(Field_Id,"(","-"),SELF)

Any ideas/tips on how to improve the expression ?



 
5 REPLIES 5

Ben.Lyons1
Staff
Staff
Hi Karan,

What currency are you trying to read and what language/locale have you set? Unfamiliar currency symbols can potentially affect the confidence, as well as nearby characters which are not currency related.

If you use a field for calculation, is best not to have it assignable to a region, otherwise you will get the issue experienced. A value cannot be both the assigned value and the calculated value. I would recommend having the assignable field separate from the calculated field. Alternatively you could do the transformation in Blue Prism.

Thanks

Ben
Ben Lyons
Principal Product Specialist - Decipher
SS&C Blue Prism
UK based

KaranBhagwani1
Level 3
Hi Ben,

Currency: $
Lang: English
Locale: Canada

The Region does not include the sign at the capture stage. The Field is not set to auto-calculate or calculate flag so there is no formula being used. BP transformation 

Are there any preferred English locale which are more stable than the others? 

Ben.Lyons1
Staff
Staff
Hi Karan,

If you're not using a formula, then where is the expression you mentioned going? (Expression: IF(EQ(STRCONTAINS(Field_Id,"("),1), STRREPLACE(Field_Id,"(","-"),SELF))

Thanks

Ben
Ben Lyons
Principal Product Specialist - Decipher
SS&C Blue Prism
UK based

KaranBhagwani1
Level 3

Hi Ben,

I meant no formula to calculate this field. Ex: Field_A + Field_B.
I switched to Text datatype so the value of "(15)" is being read as "{(15)" which is where I am trying to read it as "-15"

Ben.Lyons1
Staff
Staff
It's unclear how to proceed without seeing the document and DFD. Are you able to share some screenshots?

Alternatively you maybe entitled to some expert connected time with our professional services team. Please check with your account manager/raise a support request via the portal.

Thanks

Ben
(I'm on leave next week and will respond to any updates on my return)
Ben Lyons
Principal Product Specialist - Decipher
SS&C Blue Prism
UK based