SetProjectData

Sets project data for each data field in the given project form. Requires write access to the project. Returns data from the target form and indicates whether the form is filled out complete enough to be submitted. Target Draft data to set the unsubmitted data located on the form. The API user must be an admin to set non-draft data. Setting non-draft data saves form data and requires that the form is fully filled out.

Request

POST  /Programs/{ProgramId}/Projects/{ProjectId}/Forms/{FormId}/Data  (admin only)
POST  /Programs/{ProgramId}/Projects/{ProjectId}/Forms/{FormId}/Draft/Data

Path Parameters

Name Value Description
ProgramId string Unique identifier for the program.
ProjectId string Unique identifier for the project.
FormId string Unique or custom identifier for the form.

Optional Query Parameters

Name Value Description
run_followup_actions boolean Run followup actions after setting form data. Only available for non-draft data.

Request Body

<span class="hljs-punctuation">{
    "Project": {
        "DataFields": [
            {
                "DataFieldId": string,
                "Name": string,
                "Value": null | string
                "Values": null | [
                    string
                ]
            }
        ]
    }
}
</span>
{
    "Project": {
        "DataFields": [
            {
                "DataFieldId": "R2YX21RVSF51",
                "Value": "false"
            },
            {
                "DataFieldId": "CUSTOMID",
                "Value": "0.5"
            },
            {
                "DataFieldId": "10SQ28XRTZ9M",
                "Value": "this is text"
            },
            {
                "DataFieldId": "QGF4FF6M6CVZ",
                "Values": [
                    "2022-11-14",
                    ""
                ]
            }
        ]
    }
}
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xs:element name="ProjectDataSetResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Project">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CurrentStatus">
                <xs:complexType>
                  <xs:attribute type="xs:string" name="StatusId" use="required"/>
                  <xs:attribute type="xs:string" name="CustomId" use="optional"/>
                  <xs:attribute type="xs:string" name="Name" use="required"/>
                  <xs:attribute type="xs:dateTime" name="Timestamp" use="required"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="DataFields">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="DataField" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:choice>
                            <xs:element name="Values">
                              <xs:complexType>
                                <xs:sequence>
                                  <xs:element name="Value" maxOccurs="unbounded" minOccurs="0"/>
                                </xs:sequence>
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Value"/>
                          </xs:choice>
                        </xs:sequence>
                        <xs:attribute type="xs:string" name="DataFieldId" use="required"/>
                        <xs:attribute type="xs:string" name="CustomId" use="optional"/>
                        <xs:attribute type="xs:string" name="Name" use="required"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Attachments">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Attachment" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:attribute type="xs:string" name="AttachmentId" use="required"/>
                        <xs:attribute type="xs:string" name="CustomId" use="optional"/>
                        <xs:attribute type="xs:string" name="Name" use="required"/>
                        <xs:attribute type="xs:string" name="FileName" use="optional"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute type="xs:string" name="ProjectId" use="required"/>
            <xs:attribute type="xs:string" name="ProgramId" use="required"/>
            <xs:attribute type="xs:string" name="ProjectNumber" use="optional"/>
            <xs:attribute type="xs:string" name="LastChangeTimestamp" use="required"/>
            <xs:attribute type="xs:anyURI" name="Url" use="required"/>
            <xs:attribute type="xs:boolean" name="CanSubmit" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<ProjectDataSetRequest>
    <Project>
        <DataFields>
            <DataField DataFieldId="R2YX21RVSF51">
                <Value>false</Value>
            </DataField>
            <DataField DataFieldId="CUSTOMID">
                <Value>0.5</Value>
            </DataField>
            <DataField DataFieldId="10SQ28XRTZ9M">
                <Value>this is text</Value>
            </DataField>
            <DataField DataFieldId="QGF4FF6M6CVZ">
                <Values>
                    <Value>2022-11-14</Value>
                    <Value />
                </Values>
            </DataField>
        </DataFields>
    </Project>
</ProjectDataSetRequest>

Request Parameters

Name Value Description
Project.DataFields list List of data fields on the form.
DataFields[].DataFieldId string Unique or custom identifier for the data field.
DataFields[].Value null | string Only exists for single-instance fields. Current value of the data field.
DataFields[].Values null | list Only exists for multi-instance fields. List of current values of the data field.
DataFields[].Values[] string Current value of the data field.

Note that parameters returned from GetProjectData or SetProjectData like Project.ProjectId and Project.ProgramId are optional and ignored by the API.

Response

Response Body

{
    "Project": {
        "ProjectId": string,
        "ProgramId": string,
        "ProjectNumber": null | string,
        "Url": string,
        "LastChangeTimestamp": datetime,
        "CurrentStatus": {
            "StatusId": string,
            "CustomId": null | string,
            "Name": string,
            "Timestamp": datetime
        },
        "CanSubmit": boolean,
        "DataFields": [
            {
                "DataFieldId": string,
                "CustomId": null | string,
                "Name": string,
                "Value": null | string
                "Values": null | [
                    string
                ]
            }
        ],
        "Attachments": [
            {
                "AttachmentId": string,
                "CustomId": null | string,
                "Name": string,
                "FileName": null | string
            }
        ]
    }
}
{
    "Project": {
        "ProjectId": "231YD3N7RZ1U",
        "ProgramId": "4DYY5AZ862VM",
        "ProjectNumber": "TEST-00001",
        "Url": "http://testagency.powerclerk.com/MvcProjects/LandingPage?ProgramId=4DYY5AZ862VM&ProjectId=231YD3N7RZ1U",
        "LastChangeTimestamp": "2022-11-14T15:15:55-08:00",
        "CurrentStatus": {
            "StatusId": "UTF5UF2KAJ3T",
            "CustomId": null,
            "Name": "Application in Process",
            "Timestamp": "2022-11-14T13:39:53-08:00"
        },
        "CanSubmit": true,
        "DataFields": [
            {
                "DataFieldId": "R2YX21RVSF51",
                "CustomId": null,
                "Name": "Checkbox",
                "Value": "false"
            },
            {
                "DataFieldId": "EXD40E6S9U09",
                "CustomId": "CUSTOMID",
                "Name": "Decimal 2",
                "Value": "0.5"
            },
            {
                "DataFieldId": "10SQ28XRTZ9M",
                "CustomId": null,
                "Name": "Single Line Text",
                "Value": "this is text"
            },
            {
                "DataFieldId": "QGF4FF6M6CVZ",
                "CustomId": null,
                "Name": "Table date column",
                "Values": [
                    "2022-11-14",
                    ""
                ]
            }
        ],
        "Attachments": [
            {
                "AttachmentId": "FR7V8ZKF4WH4",
                "CustomId": null,
                "Name": "Attachment Name",
                "FileName": null
            }
        ]
    }
}
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xs:element name="ProjectDataSetResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Project">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CurrentStatus">
                <xs:complexType>
                  <xs:attribute type="xs:string" name="StatusId" use="required"/>
                  <xs:attribute type="xs:string" name="CustomId" use="optional"/>
                  <xs:attribute type="xs:string" name="Name" use="required"/>
                  <xs:attribute type="xs:dateTime" name="Timestamp" use="required"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="DataFields">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="DataField" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:choice>
                            <xs:element name="Values">
                              <xs:complexType>
                                <xs:sequence>
                                  <xs:element name="Value" maxOccurs="unbounded" minOccurs="0"/>
                                </xs:sequence>
                              </xs:complexType>
                            </xs:element>
                            <xs:element name="Value"/>
                          </xs:choice>
                        </xs:sequence>
                        <xs:attribute type="xs:string" name="DataFieldId" use="required"/>
                        <xs:attribute type="xs:string" name="CustomId" use="optional"/>
                        <xs:attribute type="xs:string" name="Name" use="required"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Attachments">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Attachment" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:attribute type="xs:string" name="AttachmentId" use="required"/>
                        <xs:attribute type="xs:string" name="CustomId" use="optional"/>
                        <xs:attribute type="xs:string" name="Name" use="required"/>
                        <xs:attribute type="xs:string" name="FileName" use="optional"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute type="xs:string" name="ProjectId" use="required"/>
            <xs:attribute type="xs:string" name="ProgramId" use="required"/>
            <xs:attribute type="xs:string" name="ProjectNumber" use="optional"/>
            <xs:attribute type="xs:string" name="LastChangeTimestamp" use="required"/>
            <xs:attribute type="xs:anyURI" name="Url" use="required"/>
            <xs:attribute type="xs:boolean" name="CanSubmit" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<ProjectDataSetResponse>
    <Project ProjectId="231YD3N7RZ1U" ProgramId="4DYY5AZ862VM" ProjectNumber="TEST-00001" Url="http://testagency.powerclerk.com/MvcProjects/LandingPage?ProgramId=4DYY5AZ862VM&ProjectId=231YD3N7RZ1U" LastChangeTimestamp="2022-11-14T15:15:55-08:00" CanSubmit="true">
        <CurrentStatus StatusId="UTF5UF2KAJ3T" Name="Application in Process" Timestamp="2022-11-14T13:39:53-08:00" />
        <DataFields>
            <DataField DataFieldId="R2YX21RVSF51" Name="Checkbox">
                <Value>false</Value>
            </DataField>
            <DataField DataFieldId="EXD40E6S9U09" CustomId="CUSTOMID" Name="Decimal 2">
                <Value>0.5</Value>
            </DataField>
            <DataField DataFieldId="10SQ28XRTZ9M" Name="Single Line Text">
                <Value>this is text</Value>
            </DataField>
            <DataField DataFieldId="QGF4FF6M6CVZ" Name="Table date column">
                <Values>
                    <Value>2022-11-14</Value>
                    <Value />
                </Values>
            </DataField>
        </DataFields>
        <Attachments>
            <Attachment AttachmentId="FR7V8ZKF4WH4" Name="Attachment Name" />
        </Attachments>
    </Project>
</ProjectDataSetResponse>

Response Parameters

Name Value Description
Project.ProjectId string Unique identifier for the project.
Project.ProgramId string Unique identifier for the program.
Project.ProjectNumber null | string The project number assigned when the project was submitted.
Project.Url string A link to the landing page for the project.
Project.LastChangeTimestamp datetime Timestamp of the last change made to the project in the time zone of the program.
Project.CanSubmit boolean Whether or not the form can be submitted.
Project.CurrentStatus object The current status of the project.
CurrentStatus.StatusId string Unique identifier for the status.
CurrentStatus.CustomId null | string Custom identifier for the status.
CurrentStatus.Name string Name of the status.
CurrentStatus.Timestamp datetime Timestamp of when the project entered the status in the time zone of the program.
Project.DataFields list List of data fields on the form.
DataFields[].DataFieldId string Unique identifier for the data field.
DataFields[].CustomId null | string Custom identifier for the data field.
DataFields[].Name string Name of the data field.
DataFields[].Value null | string Does not exist for multi-instance fields. Current value of the data field.
DataFields[].Values null | list Only exists for multi-instance fields. List of current values of the data field.
DataFields[].Values[] string Current value of an instance of the data field.
Project.Attachments list List of attachments on the form.
Attachments[].AttachmentId string Unique identifier for the attachment field.
Attachments[].CustomId null | string Custom identifier for the attachment field.
Attachments[].Name string Name of the attachment field.
Attachments[].FileName null | string Name of the file uploaded to the attachment field.