Create Facebook dashboard using Data integration platform
Introduction
This article explains how to fetch the Facebook page data using the APIs by creating workflows in the Syncfusion Data Integration Platform and to move the processed data into the SQL table to create Dashboards.
Steps involved:
Using the Syncfusion Data Integration Platform:
- To know the reach of the Syncfusion.Inc Page on Facebook by fetching the Video engagement KPI.
- Clean and process the JSON data into the required flat schema.
- Move the final processed data into a SQL database.
Using the Syncfusion Dashboard:
4. Create a dashboard for Facebook to showcase the reach of the videos on the Facebook page.
For steps 1 to 5, we will be defining a data-flow in the Data Integration Platform as shown in the following image.
Data flow in Data Integration Platform
Step 1: Flow File Creation
Generate an empty Flow file using the GenerateFlowFile processor to load data to be fetched using the Facebook API.
Step 2: Use the Facebook API to fetch data of Video Engagement KPI for the Syncfusion.Inc page.
InvokeHttp processor that is used to invoke the specified URL. Investigate to get API for any Facebook KPI using the Facebook API guide before creating the dataflow. Refer to the following configuration where you can specify the investigated API in the Remote URL property.
Step 3: Data preparation — clean and process the JSON data into required fields (attributes) using the processor — Evaluate JSON Path
In the EvaluateJsonPath processor, we have added a new property called “Value” and specified the JSON path expression to filter JSON array data present in the path.
In the SplitJson processor, specify the JsonPath Expression. SplitJson processor is used to splitting JSON array data in the specified JsonPath into separate flow files.
The EvaluateJsonPath processor that is used to filter the fields like the DateTime and value in the JSON data.
These attributes and property names will be used as column names in the SQL table.
Property names as a column in SQL table
Step 4: Replace the field content using the SQL statement
Drag the ReplaceText processor that is used to replace the content of the filtered fields in the SQL insert statement.
Step 5: Move the processed data into a SQL table
Drag the PutSQL processor the is used to execute the Insert commands to insert the fetched attributes in the SQL table.
Make sure you have created a SQL table (VideoEngagement) using the following query and create a controller service for it in the Data Integration Platform. For more details on controller settings, refer to our documentation.
The data integration workflow can be scheduled in real-time by setting it to “CRON driven” and specify CRON expression in Run Schedule so that it runs daily.
Step 6: The final step is to create a Facebook weekly comparison dashboard like the following in the Syncfusion Dashboard Cloud.
To learn the basics of creating a dashboard, refer to these links:
- Create business dashboards online
- Creating a sales dashboard with SQL Server and Syncfusion dashboards
You can follow the steps covered in these links to create your dashboards easily.
Facebook weekly comparison dashboard