How can I retrieve the body of a trigger so that I can later use of the variable values?

I am new to pipedream, I am using a Trigger which received a json object such as:

{
name: username,
email: emailvalue,
msg: message,
date: value
}

and afterward I want to send those values to airtable, however, if I just do {{steps.trigger.event.body}} I get everything and if I do {{steps.trigger.event.body.name}} then it is blank. I figured maybe I’m missing an intermediate step where I process the json object? I’m unsure…

1 Like

Hello @luigiadvance, could you share the screenshot of your event body?

I suspect that your event body is a string (containing the JSON object) instead of the JSON Object. I’ve tested with the JSON body and it works find in my side

I think it definitely is a string, I went around this by doing: const BodyObject = steps.trigger.event.body; and passing on the BodyObject to the next step and then doing things like:

{{steps.code.$return_value.message}}

how can I get the object instead of a string? sorry I can’t provide a screenshot, I changed my code since

I think it depends on your code that send the request to Pipedream. The code might stringified the body before sending the request

It literally comes from a trigger in pipedream itself, it receives a value like:

{
name: username,
email: emailvalue,
msg: message,
date: value
}

but then it’s stringified

Hello @luigiadvance,

You can use Pipedream’s code sample in the trigger to see how to send the request to Pipedream

import http.client

conn = http.client.HTTPSConnection('your-pipedream-webhook-here.m.pipedream.com')
conn.request("POST", "/", '{ "test": "event" }', {'Content-Type': 'application/json'})

I would suggest you to check the code where you make the request to Pipedream to see if it stringified the request body before sending to Pipedream.

If you’d like to have 1-1 support for your usecase, you can subscribe to Pipedream team plan, or you can hire an expert using this link: Connect with a Pipedream Partner