Workflows- set values activity not working

Gergely5
Kilo Contributor

Hi,

I am going through the learning plans provided by the ServiceNow developer portal.

I find it very useful and easy to follow but now I stuck at a challenge.

I have created a workflow to automate approval and task creation process.

If the approval is rejected then I set the state to "Closed Complete", this part works fine.

If the approval is given then I set the state to approved, then I create a task, wait for completion and depending on the result I either go to the end directly, or if it is 3 (Closed Complete) then I go to the same activity as after rejection to set the state to Closed Complete on the record in context.

But this last part doesn't work. When I check the actual context it shows that it was going through the right activities but the state remains Approved. So either the last set values activity was not executed or the record is not saved somehow.

But if I reject the approval then the same activity works fine, and the record is saved.

Any Idea?

Thanks.

14 REPLIES 14

Harish Murikina
Tera Guru

Hi Gergely,

SO when task completes is state not changin to CLosed completed ? If not what is the state value you see

Regards,

Harish Murikinati.

Gergely5
Kilo Contributor

No, the problem is not with the state of the task, it is Closed Complete.

The task state is not automated, I set it to closed complete manually.

The workflow is designed to set the parent record (Needit) to closed complete too, and this is what doesn't work.

Hi Gergely,

As per the conversation i understand the workflow is running on one table and your trying to close record of another table. Please correct me if understood correctly. Based on that will tell what needs to be done.

Regards,

Harish Murikinati.

No.

Workflow is running on NeedIt and I want to set value on NeedIt.

There is another activity which creates an NeedIt Task. And after the task is completed I want to set the field on the record on which the workflow has started.

Maybe it sounds complex but it's not... 

Here is the workflow:

find_real_file.png