Pass parameters from js transformer to query

I am writing a transformer that will call one of my GET queries.

I need to pass it a parameter for it's query parameter.

How can I do this?

ie: pseudo code

monthlyRevenueProgress - transformer

const subscriptions = {{getSubscriptions.data.subscriptions}}

for subscription of subscriptions
     const invoices = {{getSubscriptionInvoices}} -- how do I pass subscription.subscription_id??

getSubscriptionInvoices - GET Resource query

{{monthlyRevenueProgress.data}}
unless you need a single ID and without seeing your data maybe
monthlyRevenueProgress.data[0].id
Please share more information

There is enough here...

How do I pass a parameter from a script to a query or is it possible?

Use additionalScope. Check out the Docs

1 Like

Thanks for that lead!

Here is a little more info for you, since I am failing at explaining myself. (not unusual for me lol)

I was to pass the subscription_id from the script, to the GET resource query.

thisMonthPaymentProgress.js

getSubscriptionInvoices

I got it! All I had to do was put {{subscription_id}} in the request query :slight_smile:

The red error was throwing me off before, that's why I never tried it

1 Like