How To Use Editblock In Omniscript Vlocity.

Edit Block  :– Edit Blocks enable a user to add and edit multiple entries in a single array. For example, you can use an Edit Block to list and edit an Account’s list of Contacts. Edit Blocks are repeatable blocks by default. Prefilling repeatable blocks with data is possible using an array format.In this post we learn about how to use Editblock in omniscript Vlocity let us starts with explaination.

Step :–1

1. Create an OmniScript.

2. In order for users to be able to edit the record on the screen, user must be able to view the records first. Hence, we need to      fetch the record into the OmniScript using Extract Action.

3. After extracting the data, map the data with Edit Block and include as many text elements (inside the Edit Block) as the                 number of editable fields , you want to display.

4.  Include a Remote Action inside the Edit Block and configure it correctly. This will ensure that the records are updated                   without any Load Action.

Editblock in Omniscript Vlocity.
Editblock in Omniscript Vlocity.

 Step :–2

1. Edit Block Name should be the same as Extract JSON Path of DataRaptor Extract used in the Extract Action. This is how we        primarily bind the  data to the Edit Block.

2. In order to show off the editable fields inside Edit Block, bind the output JSON fields with text elements by keeping the                  exact same names of both.

3. Configure SObject Mapping and SObject Field Mappings appropriately as  show in the Demo.

4. Configure all the elements you want to show inside edit block by marking  them in ‘Elements Inside Edit Block’ as shown in          the Demo.

EditBlock
EditBlock

5. Check Allow Edit on Edit Block Properties to allow record editing on  the screen.

6. Edit Label in Edit Block Properties and Name of the Remote Action should be the same.

7. Remote Class should be “DefaultOmniScriptEditBlock” and remote method should be “edit” in the Remote Action                             Properties.

8. Edit Block Element “Id” should be mapped with SObject Field “Id” and must be set as Duplicate Key. This should also be hidden from the UI.

Editable

— after following all the steps we  will make it editable.

Scroll to Top