Using option parameters
How to use parameters in Python script


PreviousImport xplain python package and interact with Object AnalyticsNextBuild a mini data app with streamlite package
Last updated
How to use parameters in Python script


Last updated
'''
This example is based on the Demo instance
https://xoebp.xplain-data.com/objectexplorer/index.html
'''
import xplain
# replace url with your currentObject Analytics host
x=xplain.Xsession(url="https://xoebp.xplain-data.com")
# or if you're running your XOE on your local host,
#just use:
#x=xplain.Xsession()
vendor_parameter = args.get('vendor')
x.open_attribute(object_name="PurchaseDocument",
dimension_name="Vendor",
attribute_name="Vendor")
x.run({
"method": "select",
"selection": {
"attribute" : {
"object" : "PurchaseDocument",
"dimension" : "Vendor",
"attribute" : "Vendor" },
"selectedStates" : [vendor_parameter]
}
})