3 Respuestas
- Más nuevo
- Más votos
- Más comentarios
0
Parse the JSON body explicitly:
const event = JSON.parse(event);
Access properties using dot notation:
const blueprint = event.blueprint;
A few things to check:
- Make sure the JSON string is valid and parses correctly
- Check that the property name is spelled correctly
- Print out the parsed object to verify it has the expected structure
- Parsing the JSON turns it into a Javascript object that you can then access properties from using dot notation or brackets. This allows you to work with the data rather than just a string.
0
Hi, do both dot notation myObj1.blueprint and bracket notation fail? Have you tried further debugging your json key/value pairs with a loop, for example something like
for var keyval in myObj1 {
if(myObj1.hasOwnProperty(keyval)) {
console.log('key-val pair', keyval, myObj1[keyval]);
}
}
respondido hace 2 meses
Contenido relevante
- OFICIAL DE AWSActualizada hace 4 meses
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 8 meses
Thanks for the answer, however I am still not able to do what I want. I'm sending a JSON Object within the JSON that is sent to the Lambda Function from Make.com. The easiest way for me to send the data is by setting body type to Application/x-www-form-urlencoded format and then set fields to send the required data. I can receive the data in the Lambda function this way too but again how do I read it if I send the data this way.