Documentation Center

set_metadata

Set xform metadata

Description

Set metadata for user generated xform

Parameters

action
set_metadata
fid
ID of the XForm definition.
metadata_name
Name of the attribute to set on the form's root element, such as "status".
value
Value for the attribute, such as "xform.status.rejected", "xform.status.accepted", "xform.status.completed".
instance_id
ID of the XML instance of the form. This is xml file name in the database that do not include '.xml' suffix.

Example URL

http://<host>:<port>/<context>/web/xforms.xql?action=set_metadata&fid=<value>&metadata_name=<value>&value=<value>&instance_id=<value>

Successful Result

This function returns a standard API result element (<result status='SUCCESS' statusCode='0' message='Localized Message' messageKey='message.key'/>). A statusCode of 0 indicates a successful execution. Any other statusCode indicates a failure.

Failed Result

If a user does not have 'Create public Forms' permission, it will display 403 unauthorized page. In the case of an error, this function returns a standard API result element with a non-zero statusCode (such as, <result status='FAIL' statusCode='200' message='Localized Failure Message' messageKey='message.key'/>). Refer to API Error Code Reference.