Do we have option to add same key and different values if not alternate way to achieve the same.
I have to generate a report with it. so, in custom object we have to have same keys and different values that should display the same key with different value in different each row.
Please help me with this or any other way of achieving it.
Hi @likith2501,
in a custom object you cant have the same key into a map, but you can have the same key into some different map contains in a key; for example:
<Map>
<entry key="email">
<value>
<Map>
<entry key="app1" value="mail"/>
<entry key="app2" value="email"/>
</Map>
</value>
</entry>
<entry key="firstname">
<value>
<Map>
<entry key="app1" value="givenName"/>
<entry key="app2" value="firstname"/>
<entry key="app3" value="GivenName"/>
</Map>
</value>
</entry>
</Map>
I hope this can help you
1 Like
Hi @likith2501
Option 1: Store values as a list/array under the same key in the custom object.
Option 2: Use multiple keys for different values, each with unique keys (e.g., key1
, key2
, etc.).
Option 3: Use custom Java beans or Velocity scripting in reports to flatten the data into rows.
Option 4: Create multiple custom objects to represent each key-value pair as a separate object, which can then be used in the report (not recommended)
Hope that will help :).
Regards,
Muhammad