TACTIC Open Source
How to add parameters in @PYTHON() - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: How to add parameters in @PYTHON() (/showthread.php?tid=87)



How to add parameters in @PYTHON() - EricTsuei - 03-28-2020

In column expression.
How to add parameters in @PYTHON() 
for example,  I need to get some column data as a parameter feed into python

like this: 
Code:
@PYTHON(notification/dates,@GET(.asset_type))
 how to do?
and how to do in python coding?


RE: How to add parameters in @PYTHON() - listy - 03-28-2020

Hi!
In your notification/dates you already have some context which you can access through "input" variable.

from pyasm.search import Search

search_key = input['search_key']
sobject = Search.get_by_search_key(search_key)
print(sobject.get_value('asset_type'))


RE: How to add parameters in @PYTHON() - remkonoteboom - 03-28-2020

Listy here is correct. The actually trigger will have a lot of information passed to it through the "input" variable that you can extract, including the information you tried to pass in.

I just looked in the source code and to do exactly what you asked is current implemented. I guess we've always relied on the "input" variable. It might be nice to do something like:

@PYTHON(notification/dates,{mode="A"})

to make the "notification/dates" more flexible.