Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed extra returns

...

Name

Description

ModelUpsert

A Model specific node. Invokes the Upsert API on a specified model and returns the response.

Instance configuration

 

Property

Description

Required

Type

model

The name of the model of which to invoke the Upsert API.

yes

string

Instance parameters

 

Property

Description

Type

Required

id

The id of the record to upsert.

string

true

Example

 

Code Block
linenumberstrue
languagejs
collapsetrue
"model.upsert": {
 "type": "ModelUpsert",
 "config": {
   "model": "appc.arrowdb/acl"
 },
 "parameters": [
   {
     "name": "id",
     "value": "$.params[\"appc.arrowdb/acl\"].id|0"
   },
   {
     "name": "name",
     "value": "$.params[\"appc.arrowdb/acl\"].name|0"
   },
   {
     "name": "readers",
     "value": "$.params[\"appc.arrowdb/acl\"].readers|0"
   },
   {
     "name": "writers",
     "value": "$.params[\"appc.arrowdb/acl\"].writers|0"
   },
   {
     "name": "public_read",
     "value": "$.params[\"appc.arrowdb/acl\"].public_read|0"
   },
   {
     "name": "public_write",
     "value": "$.params[\"appc.arrowdb/acl\"].public_write|0"
   },
   {
     "name": "user",
     "value": "$.params[\"appc.arrowdb/acl\"].user|0"
   },
   {
     "name": "created_at",
     "value": "$.params[\"appc.arrowdb/acl\"].created_at|0"
   },
   {
     "name": "updated_at",
     "value": "$.params[\"appc.arrowdb/acl\"].updated_at|0"
   },
   {
     "name": "pretty_json",
     "value": "$.params[\"appc.arrowdb/acl\"].pretty_json|0"
   },
   {
     "name": "custom_fields",
     "value": "$.params[\"appc.arrowdb/acl\"].custom_fields|0"
   },
   {
     "name": "user_id",
     "value": "$.params[\"appc.arrowdb/acl\"].user_id|0"
   }
 ],
 "response": {
   "context": {
     "$.model|0": "model"
   },
   "routes": [
     {
       "conditions": [
         {
           "key": "$.update|0",
           "eq": true
         }
       ],
       "next": "response.success.update"
     },
     {
       "next": "response.success.create"
     }
   ]
 }
}