Detect Slack Payload

Hello everyone,

I am using slack to update things in our database. We have the slack interactive components request url that refers to a backend workflow in bubble.

We are trying to Detect Data from the payload received by slack but it doesn’t structure de data properly.

Here an example payload coming from Slack:

        "payload": 
           "{\"type\":\"interactive_message\",
             \"actions\":[{\"name\":\"Preapprobation\",
             \"type\":\"button\",
             \"value\":\"preapprobation\"}],
             \"callback_id\":\"preaprobation_modal\",
                  ... And so on ...
             } "

How can I structure the data to receive proper JSON in bubble.io?

Thank you

When you use the “Detect Data” method on a backend API workflow, you need to allow it to popup showing that it is actively waiting to detect data. So in the first image below you click the Detect Data button and it will popup the second image. Then you will need to go to slack and put the url that is showing on this second image’s popup. Then activate it. This will allow Bubble’s backend api to detect the data and format it as you show above. So in this example, the backend workflow would have an object called Request Data and it would have a payload and payload would have a type which is a text and so on. It will set the data up for you. After it has detected the data you will then get a different window where you will select the data types and press Save. After you save then go back to slack and remove the “/initialize” from the url and you will be all set to go.


@williamtisdale I think that he has done that, but slack is sending the payload JSON as text and not as JSON, hence not being able to access the data. Finding the data you want with regex would be a major pain.

@mystweb I know there’s got to be a native bubble way to do this, but I have always used integromat to accept the payload and then forward it to Bubble, as it is parsed properly for Bubble’s detection. I believe integromat has rebranded to make.

I did not consider that but can’t slack be told to send data as JSON and that would solve the issue? I have not used slack’s api specifically but usually with any api you can tell it how to send the data, right?

Hey @mystweb

What you can do is post the payload content via the API connector to an additional backend endpoint in your bubble app.

Put whatever you receive in the payload parameter in the body of the API call and also add a header Content-Type application/json.

Then detect data for this API call and Bubble will be able to parse the payload correctly.

Hope this helps.