I am building a custom plugin and setting up a bunch of api calls within the API connector in the plugin.
I have set up a an API call to be of type “action”
But then that doesn’t show up as a data type:
But if I change the type to “data” then it does show up:
If I set up this API endpoint as type “action” in the regular API connector (i.e. the one in the bubble plugins tab, not my new custom plugin):
then it shows up as expected:
Anyone know why there is this discrepancy?
@vini_brito You are one of the plugin masters. Any chance you know the answer to this?
I think this might be a bug as I had all the api calls set up as “data” so I could see them in the data type dropdown of a group. When I switched one of the api calls to an action, the dropdown value was still set to the value I want (as it was there from before) and then I set up the action to “display data in a group” and the data displayed was a result of step 1 (which is the API call action) and everything works fine.
This is somewhat akin to the hack of being able to copy an expression and paste it in somewhere that the dropdown does otherwise give you access to. Only difference is you can’t copy a data type and paste it the way you can a dynamic expression
API calls that are set to action are not available as a datasource the same way an API call set to use as ‘data’ are…thus the difference in choice there.
If you want the API call to be used as a datasource directly in a RG or some other container, you need to select use as ‘data’…if you want the API call to be used as a workflow action, then you need to select use as ‘action’.
If you select use as ‘action’ you can still have a content type to select which is the data type retrieved by the API call, and so, once the API call action is ran, you can use the display list workflow action to display the results in a RG that you set the content type to be of the retrieved API call data.
Thanks for your help but I’m not talking about the data source field. I understand the differences between “data” and “action”. I’m talking about the data type field.
As described above, if you set up the api connection the normal way in the api connector, you get access to the data type in the dropdown regardless of whether the api connection is set to “data” or “action”. But, when I set up the connection in the plugin, I’m only getting access to the data type when it is set to “data”
Okay, you should post this in the Plugin Builder section, not APIs.
True. Yes ok will do. Thanks for your help
Just FYI, I heard back from bubble support. They have informed me that this is expected behaviour. Here is their response:
After further investigation, I have been made aware that this is actually a known behavior where Plugin API Actions don’t expose a special Bubble App Type, and this creates an inconsistency with what you’re able to achieve with your API Connector Action calls, as you have noted.
For additional context here, fixing this would be a part of a larger project in distinguishing btype definitions, which our engineering team plans to tackle in the longer term. As you have alluded to in your forum post, the workaround here would be to create a duplicate call that’s a Data call instead.
The workaround they discuss is only relevant if you are the plugin owner