# Finish assignment is not working with when rule in action set

**URL:** <https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141>\
**Category:** User Experience\
**Tags:** 8-8-1, user-experience, case-management\
**Created:** [May 29, 2024, 10:03am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141 "2024-05-29T10:03:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![PratikA17159775](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@PratikA17159775](https://forums.pega.com/u/PratikA17159775)\
**Post date:** [May 29, 2024, 10:03am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/1 "2024-05-29T10:03:14Z")

</div>

Hi All,

I have a button on section which is firing two events on click

1. Run Data transform - Doing some stuff then setting a property SETFLAG to SUCCESS based on a when condition.

2. Finish Assignment - with a when condition using SETFLAG = SUCCESS

When I click the button first time only Activity runs in Tracer. Even WHEN condition is set to TRUE

Second time when I click the button, the event is taking all the actions (Run DT, Finish Assignment)

I have referred a similar article for this which is now closed.

[Finish assignment not working when used with WHEN rule | Support Center (pega.com)](https://support.pega.com/question/finish-assignment-not-working-when-used-when-rule)

I have tried everything which was mentioned in this article, but nothing worked.

any help would be appriciated.

Kind Regards,

Pratik.

---

<div class="post-metadata">

**Author:** ![SohamM95](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sohamm95/32/4726_2.png) [@SohamM95](https://forums.pega.com/u/SohamM95)\
**Post date:** [May 29, 2024, 10:54am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/2 "2024-05-29T10:54:14Z")

</div>

@PratikA17159775

When rules on actions sets work differently. The conditions will trigger based on the property values present on screen load, not on update of previous logic. So in your case, the when on finish assignment is considering the value of SETFLAG before the data transform ran. All the whens o click will run based on conditions places when the screen was rendered last time. You have to find a logic so that the screen renders again after SETFLAG is set so that the whens after run on the new condition.

---

<div class="post-metadata">

**Author:** ![Priyanka\_Boga](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/priyanka_boga/32/3726_2.png) [@Priyanka\_Boga](https://forums.pega.com/u/Priyanka_Boga)\
**Post date:** [May 29, 2024, 4:56pm UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/3 "2024-05-29T16:56:45Z")

</div>

@PratikA17159775 - Add a hidden control and add the flag property on the section where this button is present. This setting will update the UI side and server side same data when the flag is changed and when condition works as expected.

Thank you.

---

<div class="post-metadata">

**Author:** ![PratikA17159775](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@PratikA17159775](https://forums.pega.com/u/PratikA17159775)\
**Post date:** [May 29, 2024, 5:13pm UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/4 "2024-05-29T17:13:33Z")

</div>

Hi @Priyanka Boga ,

Thanks for your reply.

I have tried this, but it did not work.

Below are the steps that I followed.

1. Added the required property as hidden text in section

 ![A computer screen with a white boxDescription automatically generated.png](https://pega1.discourse-cdn.com/pega/original/2X/7/7b48ecd028673d34899c769e47da5a22c7fb103c.png)

 ![A computer screen with a chat boxDescription automatically generated.png](https://pega1.discourse-cdn.com/pega/original/2X/a/a143f334f2530e97bf9363b9f8a62ed53c13cf83.png)

1. In Search button added run data transform to set property value to 1

 ![A computer screen with a chat windowDescription automatically generated.png](https://pega1.discourse-cdn.com/pega/original/2X/8/8e061b1e9416487973ed05fca1b596b58116422d.png)

Added refresh this section with disable submit on refresh checkbox checked

1. Added Finish assignment with other property as SearchResultsCount=1

 ![A computer screen with a computer screen and a computer screenDescription automatically generated.png](https://pega1.discourse-cdn.com/pega/original/2X/8/8003a40fe04051d766a2fcc6a3ce548735b52c92.png)

Please let me know if I have missed anything.

Thanks,

Pratik.

---

<div class="post-metadata">

**Author:** ![Priyanka\_Boga](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/priyanka_boga/32/3726_2.png) [@Priyanka\_Boga](https://forums.pega.com/u/Priyanka_Boga)\
**Post date:** [May 29, 2024, 5:17pm UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/5 "2024-05-29T17:17:34Z")

</div>

@PratikA17159775 - Can you try calling the data transform within the refresh section action instead of calling standalone data transform. Because the UI is not updated when flag is changing.

Thank you.

---

<div class="post-metadata">

**Author:** ![Sindhu\_Nalajala](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@Sindhu\_Nalajala](https://forums.pega.com/u/Sindhu_Nalajala)\
**Post date:** [May 30, 2024, 9:19am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/6 "2024-05-30T09:19:19Z")

</div>

@PratikA17159775

Generally Finish assignment won’t work I also faced same issue, based on your flow and business requirement use any change stage or resolution stage

---

<div class="post-metadata">

**Author:** ![PratikA17159775](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@PratikA17159775](https://forums.pega.com/u/PratikA17159775)\
**Post date:** [May 31, 2024, 7:46am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/7 "2024-05-31T07:46:22Z")

</div>

@Priyanka Boga This change has resolved the issue. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![PratikA17159775](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@PratikA17159775](https://forums.pega.com/u/PratikA17159775)\
**Post date:** [May 30, 2024, 8:48am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/8 "2024-05-30T08:48:59Z")

</div>

@Priyanka Boga I tried this also but it didnt work.

---

<div class="post-metadata">

**Author:** ![Priyanka\_Boga](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/priyanka_boga/32/3726_2.png) [@Priyanka\_Boga](https://forums.pega.com/u/Priyanka_Boga)\
**Post date:** [May 30, 2024, 9:26am UTC](https://forums.pega.com/t/finish-assignment-is-not-working-with-when-rule-in-action-set/7141/9 "2024-05-30T09:26:14Z")

</div>

@PratikA17159775 - Can you try the changes suggested in the below article . The missing action is set value.

> **[Launching local action on when condition not working | Support Center](https://support.pega.com/question/launching-local-action-when-condition-not-working)**
>
> Issue: On change of dropdown value we are trying to launch a local action. We are having a when condition for launch of the Local Action. Though when condition is executed sucessfully, Local Action is not launched. Observation: If When rule contains...

Thank you.
