Access the output variables of an activity inside a notification activity in Orchestration workflow

sreevishnu
Tera Contributor

I have a powershell activity and the activity is having two outputs (result and errorMessage), i need to send a notification after the execution of the powershell activity with the result and errorMessage inside the body in the email notification . Currently, i am not able to get the result and errorMessage variable inside the notification.

Is there any way to access the output variable of an activity inside another activity ?

7 REPLIES 7

Prasun
Giga Guru

Hello,



Save the output in a scratchpad variable.



Like :


workflow.scratchpad.psOutput= activity.output;


workflow.scratchpad.psError= activity.error;



Use the variables in your notification block in workflow. workflow.scratchpad.psError and workflow.scratchpad.psOutput


Thanks for the reply Prasun, but if i am trying to set the scratchpad variable in the post-processing of the activity i am getting an error like



Cannot set property "new_user_id" of undefined to "1020"


can you please share the code in which can I look at?


find_real_file.png


this is my workflow i need to get the output value of get_user_id in the notification body



find_real_file.png


here you can see the output variable name new_user_id



in the post processing i am trying to add the variable to a scratchpad



find_real_file.png



here i am getting an error as


Cannot set property "new_user_id" of undefined to "1020"



find_real_file.png