Issue creating a Case with JSON Mapping

I have an API app that is receiving a request → making a few GETs + processing info → and then ultimately creating a Salesforce case. In the SFDC case connection, I’m mapping JSON to the standard Description field (textarea). Example of the format & type of JSON below.

[
  {
    "dog": "poodle",
    "age": 6,
    "success": true
  }
{
    "dog": "beagle",
    "age": 2,
    "success": true
  }
{
    "dog": "lab",
    "age": 9,
    "success": true
  }
]

I ran into deserialization errors when trying to map the JSON alone. I then ran a transform to convert the JSON to text. What’s strange is when I run the connection from the connection page (…/connection) it works however when running the entire app it fails on the Case step. If I then change the Description field mapping from the json_to_text_transform to a simple string then the app succeeds.

Any ideas on what might be causing this? Should I just parse through and create a string like, “Dog: Poodle, Age: 26, Success: True | …”. If so, how do I do that :sweat_smile:?

Hi @blschaef15! I’m not sure if I understand the the question fully here but my guess is that the “Description” field in Salesforce won’t accept the object type and it wants a string. So changing the “Transform” data operation to output a type Text will allow this to work. You can do this by changing the type on the data operation itself.

If you want to remove the JSON object structure, you can probably write some Airscript to do this and create some sort of string out of the json object.

FROM
  item
IN
  transform
SELECT
  "dog : {{
    item.dog
  }}, age : {{
    item.age
  }}, success: {{
    item.success
  }}"

Not sure if this is what you’re looking for, but does that answer your question?

1 Like

Thanks @ismaen ! Just reached out in a DM with more context + video.

1 Like

Big thanks to @ismaen for his help. The transform connection needed an Output Format of JSON and not Variable. Once that was changed everything worked!

1 Like