How do I use Zapier to send feedback to an external app?

You can use Zapier as an intermediate app to export your feedback items to a third party. In the following article, we will explain how you can do this and will use Google Sheets as a third party.

Step 1: Make a Zap

In your Zapier account, in the left panel, click on ‘Make a Zap’:

Step 2: Choose app & event

Here, add ‘Webhooks by Zapier’ as an App event and 'Catch Raw Hook' as a Trigger event.

Step 3: Set up a Webhook

After selecting Continue, copy the Webhook URL and paste this in step 2, Connect API, of the JSON hook integration in Mopinion. Select your data and give your integration a name.

Step 4: Test trigger

Go back to Zapier, and go to ‘Test trigger’. Here, you can select the request/feedback item you would like to export. Next, you can select ‘Test trigger’.

It might take a while before your feedback items from your form have been sent to Zapier.

Step 5: Code by Zapier

Add the action: Code by Zapier, and add ‘Run Python’ as Action Event.

Step 6: Run Python

In the Input data field, add raw_body and select the corresponding Raw Body. Then add the following code:

import json raw_body = input_data['raw_body'] raw_json = json.loads(raw_body) feedback = raw_json["feedback"]['_data']['fields']['_data'] feedback_labels = [i['label'] for i in feedback] feedback_values = [i['value'] for i in feedback] feedback = dict(zip(feedback_labels,feedback_values)) general_data = raw_json["feedback"]['_data'] del general_data['fields'] feedback.update(general_data) output = [feedback]

After clicking on Continue, you can Test & Review or Test & Continue to check if no errors are given.

Step 7: Action - Choose app & event

Now, you can choose your app to export to. We will choose Google Sheets. In our Google sheet, we will have rows, therefore, we will select ‘Create Spreadsheet Row’ as an action event:

Step 8: Choose account and Set up action

For Google Sheets, we will need to select our Google Sheets account, Drive, Spreadsheet and Worksheet. The columns in our sheet are: Name, Email and Ranking. Therefore, we will insert our data for these fields, by clicking on the text area, and ‘Run Python’. You might need to select ‘Show all options' to find the corresponding data. After having selected all data, click on Continue.

You can also add multiple fields, as we did with Name. You will then see both fields in your Google Sheet. See the excel image below.

Step 9: Test action

You can now Test & Review or Test & Continue to check if there are any errors again. If no errors are given, you can check your Google Sheet, and you will find the exported feedback details. If you are satisfied, you can click on the ‘Turn on Zap’ button, and you are all set.