Pass the user input from workflow task to another task in a workflow

Priyanka9
Tera Contributor

I have a custom workflow on a custom table that creates a series of tasks. The first task's user input is required in the second/next task.

I wish to store the data in 'user Input' field data somewhere in the workflow so that I can use that as a description for the next task in the workflow.

Is it possible, please suggest !!!

I think the workflow.scratchpad can be used to store the value. I'm not sure how to pass the value from the workflow task to scratchpad.

1 ACCEPTED SOLUTION

Hi,

You can still do that.

Put on run script activity in between this two tasks. Then get the journal entries.

var gr = new GlideRecord('customtablename');

gr.addQuery('parent',current.number);

gr.query();

if(gr.next()){

workflow.scratchpad.notes = gr.work_notes.getJournalEntry(-1);

}

 

Then this scratchpad can be used in next task.

Thanks,
Ashutosh

 

View solution in original post

5 REPLIES 5

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

You can use workflow.scratchpad for sure.

 

I used it in task activity as below where i want to pass the number from one task to other

 

workflow.scratchpad.num = current.number;

 

In next task you can directly use workflow.scratchpad.num whereever you want

 

Thanks,
Ashutosh

Hi Ashutosh,

The example you have given is using the current.number. Current points to the table of Workflow.

This is not working for me.

I want to store the user input/work notes that are put on the first task by the user. When this task will be completed, a new task will be created as per the workflow. In new task, I want that same info( user input/work notes) posted in the description of a new task.

I am not able to get the user input/work notes on workflow.scratchpad variable.

Please suggest what else can be done.

 

Hi,

 

Current points to the table of Workflow ? 

- Yes it point to the workflow table, If your table related to service catalog then it will not work.

like workflow.scratchpad.variable = current.number;

instead of that use below 

 workflow.scratchpad.variable = current.variables.variable_name;

 

For getting task details try to dot walk like task.fieldname and assign those to workflow.sratchpad.variable

try like below

workflow.sratchpad.variable = task.fieldname;

 

Thanks,

Kunal

Hi Kunal,

It is not a service catalog table nor RITM table.

It a custom table. 

I wish to store the user input/work notes that are put on the first task by the user. When this task will be completed, a new task will be created as per the workflow.

In new task, I want that same info( user input/work notes) posted in the description of a new task.

I am not able to get the user input/work notes on workflow.scratchpad variable.