How to set custom field to JSON object

I would like to set custom filed to JSON object like this

{
  "66a8c6a082aac46cb": "Ambiguity"
}

So I created a “Create JSON” module which returns just that. However in the input bundle of receiving module I see is as string:

{
  "name": "myCustomField",
  "value": "{\"66a8c6a082aac46cb\": \"Ambiguity\"}"
}

What is the way to achieve this?

2 Likes

That looks correct, if you are mapping a JSON string into another field.

So what do you actually want to achieve?

Hope this helps! Let me know if there are any further questions or issues.

@samliew

I’m trying the input bundle of the receiving module for the “foo” field to look like this:

..
"foo": [
  {
    "bar": "baz"
  }
]
..

Maybe I’m conceptually wrong. So here is my situation. I have 2 modules:

The output bundle of the set variable module is array of objects

But at the same time at the input of EspoCRM module it is a plain value:

The “cAccounts” field insode of EspoCRM module is configured like this:

2 Likes

Hey @CDTO_Campus

It seems you are getting array of objects from EspoCRM module. If it is, then you can use map function to get the value of cAccount like:

{{get(map(array from espoCRM;value;name;cAccount);1}}

If this is not the answer to your query, please let us know further on your challenge.

Regards,
Msquare Automation - Gold Partner of Make
@Msquare_Automation