How to write Custom Processing for each label?
We allow users to add custom processing along with a predefined list provided in the general tab.
Custom Processing:-

Important

  1. 1.
    'self' is replaced with a label name.
  2. 2.
    No space between any function
  3. 3.
    You can also combine function like UPPER(LEFT("docsumo",3))
While creating a function, anything inside single quotes is taken as variable name and double quotes is taken as string E.g: UPPER(LEFT("docsumo",3)) > "DOC" E.g: UPPER(LEFT('self', 3)) > we expect self to pass data as {'self': "docsumo") > "DOC"

Supported Functions

Function Name
Description
Example
LEFT
Returns the leftmost characters from a text value
=LEFT("docsumo",3)
RIGHT
Returns the leftmost characters from a text value
=RIGHT("docsumo",4)
SUM
Sum of all the values
d = {'a':1, 'b':4, 'self':5} =SUM('a', 'b')>5
=SUM('self')>5
SEARCHINLIST
Search the value in list provided SEARCHINLIST(text, text_to_search_with_separator, separator)
=SEARCHINLIST("hi" , "hi,hello", ",")
=SEARCHINLIST("bye" , "hi,hello", ",")
REMOVEFROMLIST
Remove words if in list REMOVEFROMLIST(text, text_to_search_with_separator, separator)
=REMOVEFROMLIST("hi world" , "hi,hello", ",")
GETDATAURL
Get value from url GETDATAURL("URL,AUTH,DATA, POST_PROESSING,METHOD")
FINDANDREPLACE
Remove word from string FINDANDREPLACE(text, list, replacing_str, separator, strict)
=FINDANDREPLACE("hi hello world namaste", "hello, world", "apple,mango", ",", 1)
PARSEADDRESS
Parse any USA address into into its component parts, like a street number, street name, suffix, and others
=PARSEADDRESS("687 NW. Woodsman St. Wheaton, IL 60187")
> {"AddressNumber": "687", "StreetNamePreDirectional": "NW.",
"StreetName": "Woodsman", "StreetNamePostType": "St.",
"PlaceName": "Wheaton", "StateName": "IL",
"ZipCode": "60187"} =PARSEADDRESS("687 NW. Woodsman St. Wheaton, IL 60187", "AddressNumber") > "687"
IF
Write complete if and else logic. You can also nest the IF similar to excel. IF(condition, True_value, False_value)
= IF(LEN('self')>5, "this is good", "this is bad") {"self": "IN1234567"}
>this is good
DELTADATE
Compare two dates to find if range falls within given interval.
DELTADATE(date1, date2, interval: defaults 30, format: defaults "dd/mm/yyyy", available: "mm/dd/yyyy" )
DELTADATE("12/12/2020","15/12/2020",1,"dd/mm/yyyy") > False
DELTADATE("12/12/2020","15/12/2020",10,"dd/mm/yyyy") > True
MAKELIST
MAKELIST(str)
Get value as list on webhook or api response.
MAKELIST('self')
MAKELIST("abc123") => ["abc123"]
MAKELIST("abc123\ndef456") => ["abc123","def456"]
TABLEOPERATOR
TABLEOPERATOR("table_name, operator")
table_name is combination of section name, table name and column name with format: section_name___table_name___column_name
operator=any of the sum or count
TABLEOPERATOR("Table Section___Table 1___Amount, sum")
TABLEOPERATOR("Table Section___Table 1___Amount, count")
PARSETELNUMBER
PARSETELNUMBER("string")
Formula to extract US telephone number form any string
PARSETELNUMBER("phone number: 1-1234.234-2323") => 1-1234-234-2323
CONVERTTONUMBER
CONVERTTONUMBER("str") Formula to extract number from any string
CONVERTTONUMBER("Amount: 5500") => 5500
CONVERTTODATE
CONVERTTODATE("str", "required_format") Formula to extract date from any string to required_format "required_format": defaults "%d/%m/%Y"
CONVERTTODATE("Date 2021/12/18","%m/%d/%Y") => 12/18/2021
CONVERTTOBOOL
CONVERTTOBOOL("str","true_values","false_values") Formula that returns True or False depending on if str is present on true_values or false_values "true_values": "yes,y,true,t,1" if str is any of above values, True is returned "false_values": "no,n,false,f,0" if str is any of above values, False is returned
CONVERTTOBOOL('t') => True CONVERTTOBOOL('0') => False
CSVOPERATOR
CSVOPERATOR(OPERATOR, TABLE_NAME___COL_NAME, params) Use database table to perform various operation. "OPERATOR": - STP: pass document through STP when certain condition met "TABLE_NAME___COL_NAME": Database table name and column name separated by ___. If value is found in the specified column, depending on params OPERATOR is executed "params": (value to be compared, column name if another column value needs to be checked/fetched, default value (if required))
CSVOPERATOR("STP,TABLE___COL, (self,COL1)")

Get a dropdown from URL

You can add a dropdown from URL.
The output should be a list. E.g ["invoice", "bank statement"]
1
url,header,data,postprocessing,method
2
E.g: https://appdocsumo.com/api/v1/eevee/apikey/limit/,X-API-KEY:Ckypp36YES,,data.document_types.loop__title,GET
3
> ["invoice", "pan", "bs"]
4
5
Detail
6
- url: str
7
- Eg: *https://apptesting.docsumo.com/api/v1/eevee/apikey/limit/*
8
- header: str
9
- Eg: *X-API-Key:asdf1234*
10
- data: dict
11
- postprocessing: str
12
- get required datas from response of **url**
13
Let: response =
14
{data: {document_types:[{"title":"TITLE1","value":"VALUE1"},{"title":"TITLE2", "value":"VALUE2"}]}}
15
- to get all titles
16
Eg: *data.document_types.loop_title*
17
Output: ["TITLE1", "TITLE2"]
18
- use .loop_ to loop through lists or [int]. to get data from specific index
19
Eg: *data.document_types.1.title*
20
Output: "TITLE2"
21
- method: str
22
- only GET and POST methods are allowed
Copied!
Happy Annotating!