Skip to content

Commit 01ecb04

Browse files
committed
update
1 parent 3a5e5ee commit 01ecb04

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/learn/rossum-formulas/formula-fields.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,24 @@ Returns line item number (indexed from 0):
123123
field._index
124124
```
125125

126+
### Get email body and subject
127+
128+
Search PO number (e.g. `PO111`) in the email subject:
129+
130+
```py
131+
email_subject = getattr(annotation.email, "subject", "")
132+
if match := re.search(r"(PO111)", email_subject, re.IGNORECASE):
133+
match.group(1)
134+
```
135+
136+
Search PO number (e.g. `PO222`) in the email body:
137+
138+
```py
139+
email_body_text_plain = getattr(annotation.email, "body_text_plain", "")
140+
if match := re.search(r"(PO222)", email_body_text_plain, re.IGNORECASE):
141+
match.group(1)
142+
```
143+
126144
### Normalize field value
127145

128146
Remove non-alphanumeric characters (except "-" and "\_"):

0 commit comments

Comments
 (0)