Rename Key

Hello, good morning everyone!
I’m stuck in the following JSON:
a part of my flow and decided to ask for help.
Look at the JSON below:

JSON:

[
{
"action_type":"link_click",
"value":7
},
{
"action_type":"post_reaction",
"value":1
},
{
"action_type":"video_view",
"value":51
},
{
"action_type":"landing_page_view",
"value":2
}
]

Would there be any way to rename each key to its value?
Example

{
"action_type":"link_click",
"value":7
}
{"link_click":7}

Would any of you have to rename all keys to their values?

Now assuming that each of them is an own item you can use the Set-Node:

3 Likes

Hello Jan,
I have a similar case, but taking into account the json informed above, would it be possible to modify it from an array with the rename key
from action_type to action_b
[
{“action”: 1
“actions_types”: [
{
“action_type”:“link_click”,
“value”:7
},
{
“action_type”:“post_reaction”,
“value”:1
},
{
“action_type”:“video_view”,
“value”:51
},
{
“action_type”:“landing_page_view”,
“value”:2
}
]
}
{“action”: 2
“actions_types”: [
{
“action_type”:“link_click”,
“value”:3
},
{
“action_type”:“post_reaction”,
“value”:5
},
{
“action_type”:“video_view”,
“value”:6
},
{
“action_type”:“landing_page_view”,
“value”:6
}
]
}
]