Transform Object-Array to Key/Value

Hi,

I have to following input parameter in my module:

	{
		"name": "metadata",
		"spec": [
			{
				"name": "key",
				"type": "text",
				"label": "Key"
			},
			{
				"name": "value",
				"type": "text",
				"label": "Value"
			}
		],
		"type": "array",
		"label": "Metadata"
	}

I need to transform this into the following format for POST request:

{
      "key1": "value1",
      "key2": "value2"
}

How can I achieve this?

Best Regards
Jörg

@Jorg_Ackermann

Your example doesn’t make sense. None of the “to” values are in the “from”.

Hi Jim,
the first parat is the declaration of the input parameter for a custom app module. And the data collected there should be transferred into the form of the example.
Best Regards
Jörg

Hi @Jorg_Ackermann
I am not sure if I understand your requirement correctly, but I assume that you’re talking about json transformation according to a schema. Well, if that’s what you are looking for, then “Create JSON” module does just that. Obviously, you still need to map your object’s fields to the schema fields. Here is an example…

  1. Schema definition

  2. Field mappings and output