How to upload your data from input fields to internal datasource
In this article, we will go through some steps that you need if you want to make a system that uploads your input fields data to our system.
Preparation
Create datasource
Firstly, you need to create your internal datasource where we want to upload all the information.
Then, set up your data fields.
Create your API key and webhook action
You can read about it in this article this article
Select Insert to internal datasource array action with the target as your created datasource.
Create the content.
Here you can download the example content and import it.
Select the EN 2 - Info collecion page.
Click on the OK button.
Select Widget -> Other -> Edit Touch Events.
Here you can select which fields of data do you want to collect.
Inside of the Action button settings
We compile the data. Here we use Execute action batch with Call function Sent fields
Script:
[fusion_syntax_highlighter theme="" language="javascript" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_right="" margin_bottom="" margin_left=""]KHJlY2VpdmVkVmFsdWUpID0+IHsKbGV0IHRpbWUgPSBEYXRlLm5vdygpOwpsZXQgcGF5bG9hZCA9IAp7CgkiZXZlbnRfaWQiOiAid2FsbGJvYXJkX3NhbXBsZSIsCiAgICAia2V5U2VsZWN0b3IiOiAiV2FsbGJvYXJkX3NhbXBsZS5yb3dzIiwKICAgICJkYXRhIjogewogICAgICAgICAgICAgICAgIk5hbWUiOiByZWNlaXZlZFZhbHVlLkN1c3RvbWVyTmFtZSwKICAgICAgICAgICAgICAgICJFbWFpbCI6IHJlY2VpdmVkVmFsdWUuQ3VzdG9tZXJFbWFpbCwKICAgICAgICAgICAgICAgICJJRCI6IHJlY2VpdmVkVmFsdWUuQ3VzdG9tZXJJZCwKICAgICAgICAgICAgICAgICJMYW5ndWFnZSI6ICJFTkciLAogICAgICAgICAgICAgICAgIkRhdGUgb2YgcmVnaXN0cmF0aW9uIGluIHRpbWVzdGFtcCI6IHRpbWUKCQkJfSwKCSJpbmRleCI6IDAKfTsKcmV0dXJuIGJ0b2EoSlNPTi5zdHJpbmdpZnkocGF5bG9hZCkpOwp9[/fusion_syntax_highlighter]
WATCH OUT FOR THIS:
- Make sure your keySelector contains your internal datasource table name:
"keySelector": "YOURTABLENAME.rows"
- Make sure you use your TABLE fields names.
"YOUR_TABLE_FIELD_NAME": receivedValue.CustomerName,
Inside of the Action button settings
We call this API with GET Special
Api URL: https://YOURSERVER/public-api/integration/webhooks?apiKey=YOURAPIKEY&payload={payload}