ERROR: JSON parameter need to be an valid JSON

Hey everyone,

I get this ERROR: JSON parameter need to be an valid JSON when i execute this code:
"

{
   "@type":"MessageCard",
   "@context":"http://schema.org/extensions",
   "themeColor":"0076D7",
   "summary": "Nouvelles informations MCO",
   "sections":[
      {
         "startGroup":true,
         "activityTitle":"Synthèse des informations de MCO"
      },
      {
         "title":"Anomalies de sauvegarde",
         "facts":[{{$json['list_machine']}}
                 ]
      }
   ],
   "potentialAction":[
      {
         "@type":"OpenUri",
         "name":"Gestion de la maintenance sur Appsmith",
         "targets":[
            {
               "os":"default",
               "uri":"[redacted]"
            }
         ]
      }
   ]
}

even tho the result of item wich is :

{
   "@type":"MessageCard",
   "@context":"http://schema.org/extensions",
   "themeColor":"0076D7",
   "summary": "Nouvelles informations MCO",
   "sections":[
      {
         "startGroup":true,
         "activityTitle":"Synthèse des informations de MCO"
      },
      {
         "title":"Anomalies de sauvegarde",
         "facts":[{"name": "BK-S013", "value": "19/05/2023"},{"name": "BK-S039", "value": "19/05/2023"},{"name": "BK-S150", "value": "19/05/2023"},{"name": "FortiAnalyzer", "value": "19/04/2023"},{"name": "SVM03", "value": "06/10/2023"}
                 ]
      }
   ],
   "potentialAction":[
      {
         "@type":"OpenUri",
         "name":"Gestion de la maintenance sur Appsmith",
         "targets":[
            {
               "os":"default",
               "uri":"[redacted]"
            }
         ]
      }
   ]
}

is a valid json (i tried to hard copy it and i worked)

My guess is that the $json[‘list_machine’] must have some kind of default value but i can’t figure what

1 Like

Hey @h_gallien,

Welcome to the community :tada:

Can you fill out the template we provide this will help us a lot, At the moment I don’t know what version of n8n you are using, what node you are trying to use or what your workflow looks like.