forked from eppye-bots/bots
-
Notifications
You must be signed in to change notification settings - Fork 2
MappingGet
skilchen edited this page Feb 17, 2016
·
1 revision
Get 1 field from the incoming message; mpath specifies which field to get. Returns: string or, if field not found, None
#get the message date from an edifact invoice:
inn.get({'BOTSID':'UNH'},{'BOTSID':'DTM','C507.2005':'137','C507.2380':None})
Explanation: get field C507.2380 from DTM-record if field C507.2005 is
'137', DTM-record nested under UNH-record.
The field to retrieve is specified as None.
Like get(), but: return a numeric string not equal to '0', otherwise
None.
Eg useful in fixed records, where a numeric field is often initialized
with zero's.
For looping over repeated records or record groups.
Typical use: loop over article lines in an order.
Returns an object usable with get(); see example.
#loop over lines in edifact order:
for lin in inn.getloop({'BOTSID':'UNH'},{'BOTSID':'LIN'}):
linenumber = lin.get({'BOTSID':'LIN','1082':None})
articlenumber = lin.get({'BOTSID':'LIN','C212.7140':None})
quantity = lin.get({'BOTSID':'LIN'},{'BOTSID':'QTY','C186.6063':'21','C186.6060':None})
[Home]
- Get started with bots
- Guide for bots-monitor
- Configuration
- How to debug
- Plugins
- Deployment and usage
- Advanced Deployment
- Troubleshooting FAQ
- Overview
- Changes and migrate
- Tutorials
- New to python?
- External reference links
- Useful Tools