Update value in database when approving a task

Hello everybody,

I need some help, it's probably really easy but I'm having some trouble. I started using Appian 10 days ago and I created a simple application. There's a dynamic form/wizard you can fill in. The data is stored in a data entity. The data from the data entity is displayed in a record grid. In this grid the data can be viewed as read only in the summary.

When the submit button is pressed a task is send to a user (initiator in this case). The task shows the form/wizard data as read only with radio buttons approve/reject and a submit button.

I'm trying to update the value in the database when that submit is pressed. In the summary I have the value displayed to see if it's working. That value remains empty now.

 

Everything except for updating the approve value is configured correctly.

My process model:

In User Input Task properties/Data/Inputs/ for the value in question I have:

Value set in parent: record

Save into: record.Approve

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Isn't it already?

    Will be back tomorrow morning (Europe time)

  • 0
    Certified Lead Developer
    in reply to sjoerds0001
    I think we might need a little more detail into your use case when you are available. For example, you didn't specifically mention that you're using a start form, but now that I re-read your original post and replies, I now assume you are using one (the first "submit" button).

    However it still seems that you are expecting a value in the database to be updated after the user input task (with the second "submit" button) is submitted; but from the screenshot of your process flow, we can see that there is no Write To Data Store node following the task - so we would not expect any update to occur after the approval task is submitted. So either your current WTDS node is in the wrong place, or perhaps alternatively, you might need a second one placed after the approval task.
  • Hello Mike,
    Thanks for your reply.
    Yeah I thought so too. I tried to add a second WTDS but it did not work. Probably my own fault.
    Some background info on this:

    I have one data store and one data type entity. The data type entity contains all variables including the form data and approval variable. When the process model goes through the first WTDS it writes all form data in the data store. In that case everything has a value except approval (that stays empty until it gets a value when the form is approved/rejected in a task). Then we get the user input task which shows the form 'read only' with radio buttons 'approve/reject' and a second submit button, different from the one filling in the form. When I add a second WTDS node after the UIT node with the same parameters as the first one it doesn't change anything. The values remain unchanged.

    **UPDATE**

    I created a second WTDS again. Made the inputs different. I removed the parent value and filled values for each one except approval. In the second WTDS I did the same but here I did it the other way around, giving only approval a value. Which brings me to the next problem. There are two entries created now. One with the form data without an approval value and another without form data with only the approval value. You can see it on the picture of the grid below:

    That needs to be one entry, so it will need to have the same ID.

  • When you first save a record you need to save its id. Then this id will be used for updating the existing record instead of creating a new one.

    For example, add Custom Output on you first save WTDS and save AC!StoredValues.id into your process variable "myRecord.id".
  • 0
    Certified Lead Developer
    in reply to sjoerds0001
    What said above is likely to be the cause - however if you still can't get it, there's a lot of other info we need (or could use at least) to help you. For example, the configuration (both input and output) of both WTDS nodes, and the output configuration (if any) of your user input task.
  • Thanks for all the help. I tried it but it didn't work. I'm afraid I'll have to leave it like this. I'm presenting my results of Appian today and have run out of time. The main point of my activities was to learn how Appian works with the available functions and I achieved that goal more than anticipated. Thanks!