Property mapping - 'SubLines e.g line.field.1.1


I’m not able to map parts of the result of a web request. As you can see in the picture below the “sub” fields are named with “.” Could that be the issue? And how to get around this?


JSON keys with dots is not supported using the result mapping directly. It is not common to have such JSON key (bad design) but that is not something we may control :wink:

So, the workaround is to add a Result Parser, where we rename that JSON key (replace the dot with an underscore in fact). You may try adding this code inside it (I’ve also commented what happens here):

//copy the response JSON object into a new variable
let ModifiedJSONResponse = rawResponseData

//Create a new JSON key on that object: System_AreaPath. Copy the value of the "System_AreaPath" key into it
ModifiedJSONResponse.value[0].fields.System_AreaPath = ModifiedJSONResponse.value[0].fields["System.AreaPath"]

//Return the new modified JSON instead of the rawResponseData
return ModifiedJSONResponse

PS: We’ve registered a challenge on this one to be able to set up the result mapping for this case as well (without the need for a result parser)

1 Like