LinkedIn
Copied!

Table of Contents

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 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 listIndex value indicates that myPageList(1) is to be deleted. You do not need to send a content element when you use DELETE.

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”
Suggest Edit
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.