Ripper
April 5, 2024, 10:31am
1
Hello,
I have problem with assigning different variables to different fields in json with the same name.
I would like to assign 3 different variables to 3 different “value” fields under parameters in a json file.
Thank you in advance for your help
My json:
{
“schemeId”: {
“name”: “660fb0a382112a661db71c9c”,
“packetName”: “idm_users”,
“packetVersion”: {
“major”: 1,
“minor”: 18,
“patch”: 0
}
},
“description”: “Save KDRCP Id”,
“parameters”: [[
{
“name”: “660fb0c1ea5d4f4ab4002518”,
“label”: “name”,
“type”: “TEXT”,
“empty”: false,
“value”:“”
},
{
“name”: “660fb0c41efba858aa01de69”,
“label”: “surname”,
“type”: “TEXT”,
“empty”: false,
“value”:“”
},
{
“name”: “660fb0b4e2cf8c7d116cad4c”,
“label”: “kdrcp_id”,
“type”: “TEXT”,
“empty”: false,
“value”:“”
},
]]
}
Anil_G
(Anil Gorthi)
April 5, 2024, 11:49am
2
@Ripper
May I know on what basis you need to assign?
Cheers
@Ripper ,
You can precisely achieve this by deserializing this json into json object then assign the values there and again serialize it back to json.
Thanks,
Ashok
Ripper
April 12, 2024, 8:03pm
4
Hello,
I made it in different way,
Just replace what i need in my json file with: ({imie}, {nazwisko}, {nr}) :
{
“schemeId”: {
“name”: “660fb0a382112a661db71c9c”,
“packetName”: “idm_users”,
“packetVersion”: {
“major”: 1,
“minor”: 18,
“patch”: 0
}
},
“description”: “Save KDRCP Id”,
“parameters”: [[
{
“name”: “660fb0c1ea5d4f4ab4002518”,
“label”: “name”,
“type”: “TEXT”,
“empty”: false,
“value”:“{imie}”
},
{
“name”: “660fb0c41efba858aa01de69”,
“label”: “surname”,
“type”: “TEXT”,
“empty”: false,
“value”:“{nazwisko}”
},
{
“name”: “660fb0b4e2cf8c7d116cad4c”,
“label”: “kdrcp_id”,
“type”: “TEXT”,
“empty”: false,
“value”:“{nr}”
},
]]
}
and I used the assigne activity with replace.
Problem solved
system
(system)
Closed
April 15, 2024, 8:03pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.