
This blog focuses on the concept and usability of flattening object feature within an Action of the Action Project.
Actions Editor – Feature List, Usage and Maintenance of Actions Project | SAP Blogs
Flattening objects refers to the process of transforming nested or hierarchical data structures into a flat structure. This can be helpful if you need to simplify data for easier processing in your business process. As a result of flattening, citizen developers are able to take advantage of the nested input and output body parameters of the action by moving up the flattened fields one level in the object hierarchy.
An Action Designer can use the flattening icon present with the key name for each parameter of type object with some properties to flatten that parameter. Let us try to understand this with an example.
Flattening an input parameter object.
An object can be flattened by using the flattening icon present with the key name as shown in figure 1.
Figure 1: Flattening an object.
When flattening icon is clicked, keyword flattened is shown along with the key name as shown in figure 2.
Figure 2: An object is flattened.
When an object is flattened, the properties present inside the object can be accessed one level up in the object hierarchy. The same can be seen in the test table as shown in figure 3.
Figure 3: Test table after flattening.
Flattening is also possible for objects present in output body as shown in figure 4.
Figure 4: Flattening available in output body
Flattening of objects present in output body helps get output parameters one level up in object hierarchy.
Note: Flattening is possible at multiple level of hierarchy as shown in figure 5.
Figure 5: Flattened object present inside a flattened object.
When test is performed after flattening parameters present in output body, the response is generated according to the new object structure as shown in figure 6.
Figure 6: Response after flattening.
Thanks for reading and I hope it helped to understand the concept of object flattening within the Actions Editor. Please feel free to leave a comment if there are any questions and I would be happy to receive any feedback.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
20 | |
20 | |
18 | |
14 | |
12 | |
11 | |
9 | |
7 | |
7 |