How to setup router or two step filter? (if/else)

Hey everyone. First time here.

I wanted to create a router or two step filter with pipedream. Need help with how to setup that.

I have an incoming webhook as a trigger. Now based on the data, I want to send an HTTP request with a custom variable.

Example:
IF Data.price == 0 ? send HTTP with tag: "free_user". ELSE Data.price > 0 ? send HTTP with tag: "paid_user. "

Currently, I have added:
Trigger -> filter 1 -> HTTP -> Filter 2 -> HTTP again.

This doesn’t feel like the best way, coz HTTP is mostly same and except the tag name.

I’m looking for:

                   ------> IF condition ------\
Trigger  ---------<                            --------> HTTP
                   ------> IF condition ------/

Possible?

Any help? Newcomer here :sob:

cc: @dylburger

Hi @surjithctly

First off, welcome to the Pipedream community. Happy to have you!

You can create a Node.js code step or a Python code step to perform this data transformation, then you can return the transformed data to the HTTP Request action via a step export.

Watch this videos to learn how to use Node.js code steps and export data from steps:

1 Like

Thank you. This seems so flexible!

Just published my first workflow :partying_face:

1 Like