How to update the task display name when the task is already created and not completed

Certified Senior Developer

Hi All,

I have a scenario where Appian task is already created with the task display name, for example as 'Task abc with amount $100".

Now when the user opens the task form, the amount will be recalculated in local variables and and are updated in database using Store Procedure execution function in local variables .

So, every time when the form loads, the amount will get refreshed and updated in Database as well.

Now my issue is ,when the amount is refreshed, the task display name should also get refresh,

for example if the amount is refreshed from $100 to $200 , then task display name should be 'Task abc with amount $200".

Note: The amount in task will get refreshed at the time of form loads, without any user interaction inside the form.

Please help me to achieve this.

Thanks in Advance.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Task names are evaluated at assignment time and (AFAIK) not evaluated again at all.  The best I suspect you'll be able to do here (though other users might have some other tricks), is to give the user a "refresh" control (button, link, etc) that secretly submits the task and loops back to it again, creating a new instance with a refreshed evaluated name.  That would require 1 user click at a minimum, but as I said I don't expect you'll get a way that has zero clicks.

    Can you tell us a bit more about your use case for wanting the Task Display Name to change?  Generally speaking, the user won't really see it after they've opened the task, unless they abandon the task again without submitting.  That's possible, of course, but seems like a bit of a corner case.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Hi Mike, thanks for your response.

    Here the task will be assigned to user like approval task ,so the approver can just open the task n-number of times and he can just view and close it.

    When he wish to approve/reject, he will do that, until then it will be in same approvers task list.

    Yes I agree with you Mike, showing some 'refresh' button or link will work. But without configuring this, if it automatically works without user interaction, then it suits the best with my requirement.

  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    I have a similar use case where the user is able to clone an existing record, which generates a new task for editing. The "Request Title" field is included in the task display name, and also editable by the user in the task. There is a case where the user would edit the Request Title and then save the task as a draft. When the user returns to their task list, the task display name is not refreshed with the updated Request Title. This is confusing to the users. 

    As you suggested, I could suppress the ootb "Save Draft" button, and create a custom submit button that loops back to the same task. That might be the way to go...

  • As you suggested, I could suppress the ootb "Save Draft" button, and create a custom submit button that loops back to the same task. That might be the way to go...

    Yes, this is the only way to update the task name at this time (restart the task).  As Mike notes, we typically use this method of a custom "Save & Close" type button that submits the task, loops back to itself so the task name can be re-evaluated.

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

    AFAIK what Mike already suggested is the only way but you can also give it a try to use "Refresh default values every time the task form is viewed" property of UIT.

  • 0
    Certified Lead Developer
    in reply to HarshKumarAgarwal

    I'd love to hear whether someone tests this to see whether or not it affects the rendered task display name - I'd guess no, but i'm actually not completely sure.

  • I'd love to hear whether someone tests this to see whether or not it affects the rendered task display name - I'd guess no, but i'm actually not completely sure.

    I can confirm this setting does not update the task name, restarting the task is the only way to re-evaluate the task name.  Running a test to confirm:

    pv!num set to 1, process started for debugging.

    pv!num updated to 2, task name still references #1:

  • 0
    Certified Lead Developer
    in reply to Chris

    Thanks, that matches my expectations (though, it woulda been nice...)

  • To complicate this even further - I'm wondering if this setting is a leftover from the old "Portal" form days (*shudder*)..  As recently, I routinely see input values being refreshed without this setting selected..  Current Documentation.  Lets run another test..

    Simple interface with a CDT and a Number input:

    Refresh not checked:

    Process started for debugging, task shows the initial values:

    I then start this separate script task which updates all 1 values to 2 in the pv's:

    Task is NOT restarted, but when it is reloaded on the front end, all values are all updated anyway:

  • 0
    Certified Lead Developer
    in reply to Chris
    start this separate script task which updates all 1 values to 2 in the pv's:

    You didn't show how the value is being passed into the interface - is it being passed into an ACP then into the form, or straight through to the form as a directly-referenced PV?  I assume these two will have potentially different behaviors keying off of the "refresh on re-open" setting.  PV values I'd expect to always reflect the latest ones; ACPs I would expect (hope?) to retain their original task-instance value UNLESS that option is checked.