transform
POSTALL,CFI/CreateNewFormInstance
Arguments
- formIdCharacter
formId of the form definition for which a new formInstance will be created
- formDataJSONCharacter
JSON data for the new formInstance
- personCharacter
the userId for the TransForm user to whom the new formInstnce is assigned.
Returns
- resultJSON Object
Returns an object with these properties:
- errorboolean
true if there was an error
- errorTextstring
- resultobject
- recordsAddednumber of rows added to the forms table
- forminstanceid
forminstanceid (i.e. primary key) of the new form instance
Description
Create a new form instance. The form type is specified by the formId. The account is the account associated with the API key.
CURL
CURL --insecure -H "apikey:Your_api_key" -H "accept: application/json" -d "{"""formId""":value_of_formId,"""formDataJSON""":{},"""person""":value_of_person}" https://transform.alphasoftware.com/transformAPIVersion1.a5svc/CreateNewFormInstanceNode
var request = require('request')
var path = 'https://transform.alphasoftware.com/transformAPIVersion1.a5svc/CreateNewFormInstance';
var data = {"formId": "value_of_formId","formDataJSON": "{}","person": "value_of_person"};
var dataJSON = JSON.stringify(data)
request.post(
{
headers: {apikey: "Your_api_key"},
url: path,
form: dataJSON},
function(err,httpResponse,body){
if(err) console.log(err)
console.log(body)
}
)Xbasic
dim apikey as c = "Your_api_key"
dim postdata as c
postdata = <<%txt%
{
"formId": "value_of_formId",
"formDataJSON": "{}",
"person": "value_of_person"
}
%txt%
dim url as c = "/CreateNewFormInstance"
dim pr as p
pr = a5dialogHelper_transformAPIQuery(url,postdata,apikey)
if pr.error = .f. then
dim result as c
result = pr.result
else
dim errorText as c
errorText = pr.errorText
end if