Request definition autocorrects

I have this Airtable API URL to get the correct parameters for the filterByFormula feature that airtable has:

https://api.airtable.com/v0/appFFDMzaGGAYkZTo/tbla1PSxklT1335Vf?filterByFormula=AND({Rent}%3D’1592’%2C{Location}%3D’Kirkwood’%2C{Year}%3D’2019’)

Whenever I try to run it by postman. It works. But when I copy and paste it the request definition on a service node. It auto-corrects to this :
https://api.airtable.com/v0/appFFDMzaGGAYkZTo/tbla1PSxklT1335Vf?filterByFormula=AND({Rent}=‘1592’,{Location}=‘Kirkwood’,{Year}=‘2019’)

This is the error when testing it.

“statusCode”: 422,
“body”: {
“error”: {
“type”: “INVALID_FILTER_BY_FORMULA”,
“message”: “The formula for filtering records is invalid: Invalid formula. Please check your formula text.”

@txhighrisers
Please look into both suggestions in the below post:

Hope this helps. Personally, I find working with encodeURIComponent better.

Can I use context variables inside the enviroment variables ?
Because I need to change the URL to include context variables from my apartmentForm digital form.
From this:
strong text

To this:

https://api.airtable.com/v0/appFFDMzaGGAYkZTo/tbla1PSxklT1335Vf?filterByFormula=AND({Rent}%3D’{{context.apartmentForm.Price}}’%2C{Location}%{{context.apartmentForm.Location}}’%2C{Year}%3D’{{context.apartmentForm.YearBuilt}}’)&maxRecords=10

@txhighrisers
No that won’t work. You can use both context variables and environment variables in script node of javascript editor ( message nodes, etc).
Environment variables are meant for environment level settings. For example you may have a bot that is for development purposes. You may have a different instance of services api you use for development only. Your production bot may need a different url. So the environment variables help you there.

You can use this API in a script node like this

context.prefRent = context.forms.apartmentpref.Price; ;
context.prefLocation = context.forms.apartmentpref.Location;
context.builtYear = context.forms.apartmentpref.Year;

context.url = “https://api.airtable.com/v0/appFFDMzaGGAYkZTo/tbla1PSxklT1335Vf?filterByFormula=AND(Rent=‘{{context.prefRent}}’,Location=‘{{context.prefLocation}}’,Year=‘{{context.builtYear}}’)&maxRecords=5

and you can use context.url in a service call.