Page instructions for page lists
You can use page instructions to specify whether an embedded page in a page list within the post data is to be updated, replaced, appended, inserted, moved, or deleted from your case.
Page instructions for page lists include listIndex
, which you use to
specify the index of the page list that you want to modify. For example, your
application contains myPageList(1)
and
myPageList(2)
. When you specify “listIndex” : 2
, you are indicating that myPageList(2)
should be
modified.
The following page instructions are available:
UPDATE
REPLACE
DELETE
APPEND
INSERT
MOVE
The following example is a case before a page instruction is added:
myPageList(1)
.Prop1 – “value1”
.Prop2 – “value2”
myPageList(2)
.Prop1 – “value3”
.Prop2 – “value4”
Update
You use UPDATE
to modify the value of an existing property in a page
list, for example, when a user edits a row.
The following example is the post body when the UPDATE
page
instruction is added:
“pageInstructions” : [{
“instruction” : “UPDATE”,
“target” : “myPageList”,
“listIndex” : 2,
content : {
“Prop1” : “value5”,
}
}]
.Prop1 - "value3"
in myPageList(2)
is updated with
"value5"
:
myPageList(1)
.Prop1 – “value1”
.Prop2 – “value2”
myPageList(2)
.Prop1 – “value5”
.Prop2 – “value4”
Replace
You use REPLACE
to overwrite an existing row in a page list.
The following example is the post body when the REPLACE
page
instruction is added:
“pageInstructions” : [{
“instruction” : “REPLACE”,
“target” : “myPageList”,
“listIndex” : 2,
content : {
“Prop1” : “value5”,
}
}]
.Prop1 – "value3"
in myPageList(2)
is replaced with
"value5."
. .Prop2 – “value4”
is
overwritten:
myPageList(1)
.Prop1 – “value1”
.Prop2 – “value2”
myPageList(2)
.Prop1 – “value5”
Delete
You use DELETE
to delete a row in a page list.
The following example is the post body when the DELETE
page
instruction is added:
“pageInstructions” : [{
“instruction” : “DELETE”,
“target” : “myPageList”,
“listIndex” : 1,
}]
The original myPageList(1)
was deleted, and
myPageList(2)
becomes myPageList(1)
:
myPageList(1)
.Prop1 – “value3”
.Prop2 – “value4”
Append
You use APPEND
to add a new row after an existing row.
The properties indicated in the page instruction are automatically added after the
last existing row. listIndex
is not used with an
APPEND
.
“pageInstructions” : [{
“instruction” : “APPEND”,
“target” : “myPageList”,
content : {
“Prop1” : “value5”,
“Prop2” : “value6”
}
}]
A third page list with “Prop1” : “value5”
and “Prop2” : “value6”
is created below the existing page lists:
myPageList(1)
.Prop1 – “value1”
.Prop2 – “value2”
myPageList(2)
.Prop1 – “value3”
.Prop2 – “value4”
myPageList(3)
.Prop1 – “value5”
.Prop2 – “value6”
Insert
You use INSERT
to insert a new row before an existing row.
The following example indicates that a new page list with properties “Prop1” : “value5”
and “Prop2” : “value6”
should be inserted
as the second row:
“pageInstructions” : [{
“instruction” : “INSERT”,
“target” : “myPageList”,
“listIndex” : 2,
content : {
“Prop1” : “value5”,
“Prop2” : “value6”
}
}]
The new page list is inserted as myPageList(2)
. The page list that
was previously myPageList(2)
becomes
myPageList(3)
:
myPageList(1)
.Prop1 – “value1”
.Prop2 – “value2”
myPageList(2)
.Prop1 – “value5”
.Prop2 – “value6”
myPageList(3)
.Prop1 – “value3”
.Prop2 – “value4”
Move
You use MOVE
when a user drags and drops a row.
listIndex
indicates the previous position of the row, and
listMoveToIndex
indicates the row's new position.
In the following example, the user is moving myPageList(2)
to the
myPageList(1)
position:
“pageInstructions” : [{
“instruction” : “MOVE”,
“target” : “myPageList”,
“listIndex” : 2,
“listMoveToIndex” : 1
}]
myPageList(2)
becomes myPageList(1)
, and the
original myPageList(1)
becomes myPageList(2)
:
myPageList(1)
.Prop1 – “value3”
.Prop2 – “value4”
myPageList(2)
.Prop1 – “value1”
.Prop2 – “value2”
Previous topic Page instructions for page groups Next topic Updates to page lists and page groups with newRow