Skip to content

Custom Field Samples

To create an optional, text, custom field, with no default value, you would include the following XML within the custom fields array on the job:

<custom_field>
    <name>A Sample Field</name>
    <value></value>
</custom_field>

To create a read only, number, custom field with the default value of 5, you would include the following XML within the custom fields array on the job:

<custom_field>
    <name>Another Sample Field</name>
    <type>number</type>
    <value>5</value>
    <permission>read_only</permission>
</custom_field>

To create a hidden custom field that references pick list 12345, with the default value of foo, you would include the following XML within the custom fields array on the job:

<custom_field>
    <name>A Sample Pick List</name>
    <type>pick_list</type>
    <pick_list_id>12345</pick_list_id>
    <value>foo</value>
    <permission>hidden</permission>
</custom_field>

To replicate the example above, but as a multi value pick list, you would include the following XML within the custom fields array on the job:

<custom_field>
    <name>A Sample Pick List</name>
    <type>multi_pick_list</type>
    <pick_list_id>118558</pick_list_id>
    <values type="array">
        <value>foo</value>
        <value>foo2</value>
    </values>
    <permission>optional</permission>
</custom_field>

To create a mandatory, blank, location custom field, you would include the following XML within the custom fields array on the job:

<custom_field>
    <type>location</type>
    <name>Record Location of Planting</name>
    <permission>required</permission>
</custom_field>

To create an optional, populated, location custom field, you would include the following XML within the custom fields array on the job:

<custom_field>
    <type>location</type>
    <name>Location of Damaged Equipment</name>
    <lat>-36.849919</lat>
    <lng>174.7624623</lng>
    <formatted_address>34893 Albert Street, Auckland CBD, Auckland 1010, New Zealand</formatted_address>
</custom_field>

Supplying values for images, or signatures is not currently supported.