Hi Alex, in mapJson in the left fields you must use the structure to find the attribute and not just its name.
I am sending you an example code.
defVar --name phonenumberType --type String
defVar --name employee_name --type String
defVar --name age --type Numeric
mapJson --json "{\n \"employee_name\": \"John\",\n \"employee_salary\": \"doe\",\n \"person\": {\n \"age\": 30\n }\n}" --mappings "{\"$.employee_name\":\"${employee_name}\",\"$..age\":\"${age}\"}"
logMessage --message "Name: ${employee_name}\r\nAge: ${age}" --type "Info"
------------------------------
Angelo Alves
IBM RPA Technical Specialist
------------------------------
Original Message:
Sent: Wed May 17, 2023 05:35 PM
From: Alex Virrueta
Subject: Map to JSON
Hi
I tried to get data from a json in order to polulate an Excel file, so I'm using Map to JSON comand, like the image below
When I run the bot an error shows.
5/17/2023 4:33:51 PM - Error executing command at line 21: mapJson --json "${DataJson}" --mappings "{\"employee_name\":\"${Nombre}\",\"employee_salary\":\"${Salario}\",\"employee_age\":\"${Edad}\"}"
Unexpected character encountered while parsing value: s. Path '', line 0, position 0.
Thnaks for your help
------------------------------
Alex Virrueta
------------------------------