I am trying to call the global value 'total_rows' inside the expression. But I am getting an error.
and my code is
def execute(self, parameters, messages):
"""The source code of the tool."""
inputdataset = parameters[0].valueAsText #getting the parameters
count_rows = arcpy.GetCount_management(inputdataset)
total_rows = int(count_rows.getOutput(0))
expression = '''
def getCitation(p_dataset_id):
global total_rows
if(total_rows == 5):
ds=PanDataSet(p_dataset_id)
return ds.citation
'''