Applications → Working with Forms → Customizing Forms → Managing Form Behavior → Using Form Widgets → Using the REST Grid Widget → Intercepting and Manipulating REST Data
In SBM Composer, you can intercept data retrieved through the REST Grid widget and manipulate it before it is displayed on the form. For example, you can use this in situations where the REST calls do not return data in a format that the REST Grid is capable of processing. Another example is where the REST caller runs different reports that return different columns, and you need to map specific columns to data on the form before you display it.
To intercept the data, you use the AddResultCallback() function call in JavaScript. You can then use additional JavaScript code to manipulate the data as needed. For example, if your REST data returns data in a hierarchical way through an array, you could use JavaScript to convert it to a flat data structure so that it can be displayed as a list format in the REST Grid widget.
For information on AddResultCallback(), refer to SBM JavaScript Library Guide.
You can include the JavaScript in one of the following ways:
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.