Difficulty Passing Dynamic Parameters in API Connector

Hello Bubble Community,

I’m encountering an issue with passing dynamic parameters in the API Connector. Specifically, I’m trying to construct the following API call:

bash

Copy code

https://rest.method.me/api/v1/files?table=Contacts&recordId=[recordid]

In this setup, [recordid] should be a dynamic value sourced from user input or a workflow. Despite following the standard procedures, the API call doesn’t seem to recognize the dynamic parameter correctly, leading to unexpected results.

Steps I’ve Taken:

  1. API Connector Setup:
  • Configured the API endpoint with the parameter recordId.
  • Unchecked the “Private” option for recordId to allow dynamic input.
  1. Workflow Configuration:
  • In the workflow, I set the recordId parameter using dynamic data from an input field.
  • Ensured the input data is correctly formatted as text.
  1. Debugging Attempts:
  • Used Bubble’s debug mode to trace the workflow execution.
  • Checked browser developer tools to inspect the outgoing HTTP request.

Despite these efforts, the API call doesn’t function as expected when using dynamic parameters. However, when I hardcode the recordId value directly in the API Connector, the call works perfectly.

Request for Assistance:

Has anyone faced a similar issue with dynamic parameters in the API Connector? Are there additional settings or steps I might be overlooking to ensure the dynamic parameter is correctly recognized and passed in the API call?

Any insights or suggestions would be greatly appreciated.

Thank you in advance for your help!

Not sure if there is confusion on how this works, but you do need to initialize the call first in API connector with the dynamic [id] value filled in via the input in the API connector. Once that is done, you should have no issues with the way you expressed things are setup so long as the [id] is not private and your input value is passed in properly to the API call action.

As always, sharing screen shots can be helpful in getting assistance. I often overlook something obvious to others that my screen shots are the only way for them to spot for me.

shouldn’t have any issues with this

  1. setup the api connector
  2. initialize the connector
  3. set it to action (most likely based on your example)
  4. run it in a workflow from button click
  5. pass the value into the param for the api action

you may get an issue if the value is not url encoded depending on the api you’re using… but it should give you an error

  1. add “an unhandled error occurs” to show an alert to the user for the error or check the console

for sure I will post some screenshots heres waht i’ve confirmed through testing
btw usually a .Net architect but a new project and having oh so much fun! lol

  1. I did initiallize the call
  2. it works in postman
  3. I have trimmed the record id parameter being passed into and it is 4 characters, so the param is good
  4. I have tried to url encode it and no luck
  5. this is using the API Connector and MEthod CRM
  6. I have hard coded the value

the biggest issue i’m running into is not being able to see the HTTP get call being made at the time of action, maybe missing a header or something?

I doubt it because other HTTP gets work

I’m not even getting raw text or an error back and so i can onky conclude that something must be aloof in the HTTP Get call

let me provide some screenshots

for sure I will post some screenshots heres waht i’ve confirmed through testing
btw usually a .Net architect but a new project and having oh so much fun! lol

  1. I did initiallize the call
  2. it works in postman
  3. I have trimmed the record id parameter being passed into and it is 4 characters, so the param is good
  4. I have tried to url encode it and no luck
  5. this is using the API Connector and MEthod CRM
  6. I have hard coded the value

the biggest issue i’m running into is not being able to see the HTTP get call being made at the time of action, maybe missing a header or something?

I doubt it because other HTTP gets work

I’m not even getting raw text or an error back and so i can onky conclude that something must be aloof in the HTTP Get call

let me provide some screenshots

I solved it, i just recreated the API Call, and it fixed the original one and the current one

crazy moments in the matrix bubble

but bubble is awesome!

Probably was the parameter with no key name, no value and set to private.

actually the bug cam back, i contacted support but they were too busy today the second level support.

but no not that obvious about the Value, Private and no key name

its how theyre intepretting dynamic fields in this specific http get

I’ve made sure its trimmed and URL Encoded the parameter

and also remember when it’s hardcoded or default values it works

this is an upgraded latest version maybe that has something to do with it, etc

and it works in postman

it is specifically with thier dynamic field potentially

lets see, geting so desperate and bubble didn’t have time for me today
:expressionless:

That message is important…re-initialize your call

@onecallonly
I have EXACTLY the same issue than you. Actually, when I take a look about my API logs, I see that it always sends the default value instead of the dynamic one.
Did you find how to solve it?
Thanks.

This bug is really strange… More details below.

I have configured an API call through API connector, that has one parameter called k_category_id (number value, default = 1)

It’s then used in a workflow in which it takes admin’s last_category_created value (which evaluates to a number)

I see on the API server’s side that the number that is sent is not the one that is expected.

Some tests:

  • if I keep admin’s last_category_created value, it sends 1 (the default value). In the debugger when I pause on this workflow step, I see the right value should be taken

  • if I use ‘Arbitrary text:converted to number’ with admin’s last_category_created inside the arbitrary text => same, the right value is put on the debugger, but it still sends 1 to the API

  • if I use admin’s last_category_created + 5, the debugger says it will send the expected value (last_category_created + 5). In reality, it send 5!

  • I I use admin’s last_category_created:floor, the debugger says it will send the expected value. In reality, it sends 0