Forum Discussion

conner_davis's avatar
conner_davis
Ideator I
2 years ago
Solved

Updating an Existing Property on Workflow vote

Hello, After a user votes on a workflow, I want to update an existing property (_conversation_history). The code below is what I am using. It appears that the code is generating the correct strin...
  • AngelaIp's avatar
    2 years ago

    I don´t see any "apply" in your code. You set the Property, but only to the temporary context. You don´t seem to use edit/apply to actually save your new value. 

    And I see a second problem. As far as I understand you want to update your history value:

    You use this line to get the value:

    string history = controlledItem.getProperty("_conversation_history","");

    But that line to update the value:

    this.setProperty("_conversation_history",newconvo);

    In your context "this" represents the "Activity" item while controlledItem represent your change process. 
    I am not sure if controlledItem.setProperty in combination with edit/apply would work, cause the controlled item is something generated by the helper function. But you can give it a try. 

    If it doesn´t work, get the id of the controlledItem and do a direct edit of the Change process.