LinkedIn
Copied!

Page instructions for page groups

You can use page instructions to specify whether an embedded page in a page group within the post data is to be updated, replaced, added to, or removed from your case.

Page instructions for page groups include the groupIndex operation, which you use to specify the subscript of the page group that you want to modify. For example, your application contains myPageGroup(Phone) and myPageGroup(Email). When you specify “groupIndex” : Phone, you are indicating that you want to modify myPageGroup(Phone).

The following example is a case before a page instruction is added:

myPageGroup(Phone)
.Prop1 – “value1”
.Prop2 – “value2”
myPageGroup(Email)
.Prop1 – “value3”
.Prop2 – “value4”

UPDATE

You use UPDATE to modify the value of an existing property in a page group, 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” : “myPageGroup”,
         “groupIndex” : Phone,
          content : {
             “Prop1” : “value5”,
        }
    }]

.Prop1 - "value1" in myPageGroup(Phone) is updated with "value5":

myPageGroup(Phone)
.Prop1 – “value5”
.Prop2 – “value2”
myPageGroup(Email)
.Prop1 – “value3”
.Prop2 – “value4”

REPLACE

You use REPLACE to overwrite an existing row in a page group.

The following example is the post body when the REPLACE page instruction is added:

“pageInstructions” : [{
         “instruction” : “REPLACE”,
         “target” : “myPageGroup”,
         “groupIndex” : Email,
          content : {
             “Prop1” : “value5”,
        }
    }]

.Prop1 – "value1" in myPageGroup(Email) is replaced with "value5." .Prop2 – “value4” is overwritten:

myPageGroup(Phone)
.Prop1 – “value1”
.Prop2 – “value2”
myPageGroup(Email)
.Prop1 – “value5”

DELETE

You use DELETE to delete a row in a page group.

The following example is the post body when the DELETE page instruction is added: 

“pageInstructions” : [{
         “instruction” : “DELETE”,
         “target” : “myPageGroup”,
         “groupIndex” : Phone,
    }]
The groupIndex value indicates that myPageGroup(Phone) is to be deleted. You do not need to send a content element when you use DELETE.

myPageGroup(Phone) is deleted:

myPageGroup(Email)
.Prop1 – “value3”
.Prop2 – “value4”

ADD

You use ADD to add a new row in a page group.

The following example indicates that a new page group with the subscript Family should be added:

“pageInstructions” : [{
         “instruction” : “ADD,
         “target” : “myPageGroup”,
         “groupIndex” : Family,
          content : {
             “Prop1” : “value5”,
             “Prop2” : “value6”
        }
    }]
If you try to add a page group that already exists, an error occurs.

myPageGroup(Family) is added:

myPageGroup(Phone)
.Prop1 – “value1”
.Prop2 – “value2”
myPageGroup(Email)
.Prop1 – “value3”
.Prop2 – “value4”
myPageGroup(Family)
.Prop1 – “value5”
.Prop2 – “value6”
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.