Skip to main content

I developed a learning instance where I have an amount field. The value in the PDF document for Amount field is like “USD 495.23”. I would like to extract only the Amount part excluding “USD “ i.e. 495.23. I believe this can be achieved using the regex option in the “Field Rules” but not sure how. Can someone help me here. Thanks in Advance. 

Hi ​@Srini 6969,

 

You can use the following regular expression in your Field Rule → Regex Match:
(?<=USD\s)\d+\.\d{2}


This will match:

USD 495.23 →  495.23
USD 12.00 →  12.00

 

1. Open your Learning Instance.
2. Go to the Field for Amount.
3. Click on Field Rules.
4. Add a new rule:

  • Condition: Regex Match
  • Pattern: (?<=USD\s)\d+\.\d{2}

5. In the Action, choose:

Set Value → Use the matched value (this will automatically set the field to the regex match).


If the prefix could be USD, EUR, etc., and you want to extract any amount regardless of currency, use:
(?<=\b[A-Z]{3}\s)\d+\.\d{2}


Note: The regex extract action will return only the first match found in the field value. If the pattern doesn’t match, the field will be empty.


@Padmakumar ​@Srini 6969 I tested this and it worked: Great idea, Padmakumar!