ProcFormAdd

The API endpoint to add a form to a process is ProcFormAdd, we’ll add a new form to the process created on the previous part:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
POST http://localhost/rpm/Api2.svc/ProcFormAdd HTTP/1.1
host: localhost
 
{
    "Key""7c2c1037-b6fd-4b0a-b403-9ed39062ad76",
    "ProcessID""2781",
    "Form": {
        "Fields": [
            {
                "Field""Yes/No List field",
                "Value""{\"Values\":[{\"OptionID\":14321195,\"Value\":1,\"Comment\":\"Comment for this option\"},{\"OptionID\":14321196,\"Value\":2,\"Comment\":\"\"},{\"OptionID\":14321198,\"Value\":1,\"Comment\":\"\"}]}"
            }
        ]
    }
}

Note: The response from the request to ProcFormAdd will contain the internal FormID for the new form. This is useful if you need to be able to edit the form afterwards.

The field on the new form:
ProcFormAdd

ProcFormEdit

To edit a form, we use the ProcFormEdit API endpoint:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
host: localhost
 
{
    "Key": "7c2c1037-b6fd-4b0a-b403-9ed39062ad76",
    "ProcessID": "2781",
    "Form": {
        "FormID": 221498,
        "Fields": [
            {
                "Field": "Yes/No List field",
                "Value": "{\"Values\":[{\"OptionID\":14321195,\"Value\":1,\"Comment\":\"Updated comment for this option\"},{\"OptionID\":14321196,\"Value\":1,\"Comment\":\"\"},{\"OptionID\":14321198,\"Value\":2,\"Comment\":\"\"}]}"
            }
        ]
    }
}


The field on the updated form:


ProcFormEdit