This topic was automatically generated from Slack. You can find the original thread here.
Hi, I need to integrate Adapty with Pipedream. To connect them, Pipedream needs to respond with the value of adapty_check in JSON format. how can I reference the value?
You’re very very close. You can hover over individual fields in the Exports tab of a step and click the Copy Path option to copy the path to that export.
I’m not sure how to go from there, I copied the path of the property I need, what should I do now, should I create a new step to return an HTTP JS response and reference the value?
Is it not possible to reference the value in the trigger itself?
I always recommend reading Eloquent Javascript to start learning the fundamentals of using Node.js / Javascript. It’s free and it’s well worth the time to read and grasp the language before trying to make API calls.
However, you can also ask Pi our GPT-3 trained bot on coding questions like these.
Sure! You can use the $.respond() function to return an HTTP response with the adapty_check value from the trigger. Here’s an example of how to do that: export default defineComponent({ async run({ steps, $ }) { const adapty_check = steps.event.trigger.body.adapty_check; await $.respond({ status: 200, headers: { "Content-Type": "application/json" }, body: { adapty_check: adapty_check }, }); }, }); This code will return an HTTP response with a JSON object containing the adapty_check value from the trigger.
It looks like your code is set up correctly to return the adapty_check value in the HTTP response. However, if you’re still receiving a generic response, it might be because the trigger is not configured to use the custom response from the workflow. To fix this, please follow these steps: 1. Click on the trigger step in your workflow (the first step, usually named “HTTP / Webhook”). 2. In the right panel, scroll down to the “Advanced Settings” section. 3. Check the box next to “Respond with custom response from the workflow”. 4. Save the changes and redeploy your workflow. Now, when you send a test request, it should return the custom response generated by your code step.