I used Python Edit Variables to create 4 variables and named them as Groups, Pivots, Aggregations, ColumnType, then apply them to config Pivoting Node in workflow variables tab.
I defined variables Groups and Pivots in Python Edit Variables node by the following code:
flow_variables['Groups'] = 'SERIAL_NUM' if 'HD_PHYS_PSN' not in flow_variables['PARAM_NAME'] else 'SERIAL_NUM,HD_PHYS_PSN'
flow_variables['Pivots'] = 'STATE_NAME' if 'HD_PHYS_PSN' not in flow_variables['PARAM_NAME'] else 'STATE_NAME,OPERATION'
if 'HD_PHYS_PSN' does not exist in flow_variables['PARAM_NAME'], the 2 variables will be SERIAL_NUM or STATE_NAME separately, and set groupcolumn with Groups, pivotcolumn with Pivots in workflow variables, it works.
if 'HD_PHYS_PSN' exists in flow_variables['PARAM_NAME'], the 2 variables will be SERIAL_NUM,HD_PHYS_PSN or STATE_NAME,OPERATION separately, and set groupcolumn with Groups, pivotcolumn with Pivots in workflow variables, it does not work this time.
why single value of a variable works but two values does not work?