Build a Video Approval Tool on Appsmith with Airtable and Notion 

Tags: opensource, lowcode, appsmith, tutorial
Published: 2022-03-04 17:47:48

Video content rose even before the pandemic, but the pandemic certainly
has accelerated consumption. [According to research](https://www.forbes.com/sites/falonfatemi/2021/02/01/how-the-pandemic-has-changed-video-content-and-consumption/?sh=1e22a03b6ec0), 82% of content generated in 2022 is likely to be video. Video is ruling the social media landscape and will stay for a while. Marketing companies especially take advantage of this trend by incorporating video content production into their strategy. There have to be tools that take the idea into motion with all great ideas. Video approval tools are a great way to quickly organize workflows and ensure seamless creation, production, and publication of video content.

In this article, I will teach you how to make a video approval workflow
using Airtable, Notion, and Appsmith. As a low code, open-source
framework Appsmith makes it simple to create internal apps as support
for any platform, like the collaborative workspace Airtable.

Let's deal with a specific case; the marketing office has to manage a
list of videos uploaded on Airtable by an external supplier.

This is what the workflow could be:

1.  The videomaker uploads a new video on Airtable

2.  The marketing employee views it, writes notes for the supplier, and
     changes its status.

3.  The marketing head needs a synthetic view of the video's progress
     on Notion.

## The Video Approval App

Let's see the app first, then I'll show you how to build it in the next
section. With this app, you can review, edit details, and approve
uploaded videos in one place.

In the following sections, I will go through the app's different
features.

There would be a record for each video uploaded; we can view these
videos on the box on the left by clicking on one of the uploaded videos.
![image39](https://user-images.githubusercontent.com/9484568/156806650-28b30f25-b717-4fb7-9362-c3aeb9227570.gif)


It is also possible to filter the list just using the filter
functionality.

![image9](https://user-images.githubusercontent.com/9484568/156806708-ce7a3b4f-8511-49c2-b0d2-40d7f9d34fbb.gif)

The description field is editable

![image29](https://user-images.githubusercontent.com/9484568/156806764-9aa062c7-e8dd-467d-aad6-a953f4d05bef.gif)


With the 'Approve' button, you can approve the video and see changes in
the status.

![image3](https://user-images.githubusercontent.com/9484568/156806809-b7bfe8d3-8497-4568-94ed-7be5d8cc03b5.gif)


### Get Data and Updates in Airtable
A new video that the video maker
has uploaded shows up on the Appsmith desk to review immediately.

![image34](https://user-images.githubusercontent.com/9484568/156806893-cd35a460-c537-46d1-b5e6-07bbf5e9359a.gif)


After the approval of a video, the information instantly flows to
Airtable in the same way.

![image17](https://user-images.githubusercontent.com/9484568/156806974-98df580a-ffb8-4c68-b584-f721fd24e2f1.gif)


### Change video status, leave comments
After selecting the video,
users can 'Request a new update' and change the status. Users will also
be able to leave comments.

![image7](https://user-images.githubusercontent.com/9484568/156807073-500a3986-8e4d-45fc-a461-1b9edcf73788.gif)

### Download the data in CSV or excel format
Each table can be exported
in CSV or excel format by simply clicking on the 'download' button.

![image2](https://user-images.githubusercontent.com/9484568/156807111-977601bf-d2cc-484c-92a1-a6279079602f.gif)



**Customize the template by adding any data visualization modules to
connect other third parties:** To monitor the approval activity,
Appsmith provides data visualization modules that you can customize.

![image19](https://user-images.githubusercontent.com/9484568/156807176-5fb044b7-9d86-4597-a165-f5675c2105c0.gif)


Imagine that the marketing chief needs to be informed instantly of the
video approval process; in particular, they want to know how many and
which videos have 'approved' status. You can connect your Appsmith
platform with the third party you prefer. For example, you can do it
with Notion.

![image18](https://user-images.githubusercontent.com/9484568/156807246-e72b6686-cb6a-43f0-b0c8-7b9ef2483b91.gif)

To see the Applications in action, you can [follow this
link](https://app.appsmith.com/applications/6176aa49da0db7441710c454/pages/6176aa49da0db7441710c456).

## How to build the App

Let's keep a few basics in place.

-   Create a new account on Appsmith (it's free!), if you are an
    existing user, log in to your Appsmith account.

-   In Appsmith, create a new application. You will see a new Appsmith
    app with an empty canvas and a sidebar with two directories:
    Datasources and Widgets.

-   In another tab, open Airtable. If you don't have an account created,
    create an account and log in.

-   In another tab, open Notion. If you don't have an account created,
    create an account and log in.

Now, let's begin building the app. Open Appsmith and go to the following
sections: Widgets, Datasources, JS Objects.

### Create an API interface

Appsmith can be used to test API, as it can be done with tools like
Postman, but with Appsmith, it is possible to prototype the frontend in
the meantime. I think this is a powerful feature!

As you can see in the box below, the app has a list of API calls
executed on Airtable and Notion API. Each one performs a different
action in our Video Approval App.

![image26](https://user-images.githubusercontent.com/9484568/156807359-2ba52f98-7116-44d8-ad0d-2b13b4a05c33.png)

To do this, you have to login into Airtable, create a workspace, and
then create three tables that represent the information needed that
needs tracking. In this example, we name them 'log',
'sailingvideotable' and 'countRowStatus'.

These tables are supposed to be used by dedicated users.

![image28](https://user-images.githubusercontent.com/9484568/156807438-b58d6a58-e7de-476f-b05d-9569b1ab7373.png)


Table 'log' is used when someone wants to leave a comment on a
particular video, it has the following data structure:

-   'id' as 'single line text' type

-   'Name' as 'long text' type

-   'Reason' as 'reason' type

-   'Status' as 'single line text' type

-   'Date' as 'long text' type

Table 'sailingvideotable' is used to collect information related to
the videos that have to be approved, it has the following data
structure:

-   'myid' as 'single line text' type

-   'Status' as 'single line text' type

-   'Name' as 'single line text' type

-   'Description' as 'long text' type

-   'Attachments' as 'attachment' type

-   'hook' as 'link to another record' type

-   'hook' as 'lookup' type

-   'isApproved' as 'formula' type

-   'isNotApproved' as 'formula' type

-   'isOngoing' as 'formula' type

-   'isNew' as 'formula' type

Table '**countRowStatus**' is a rollup of 'sailingvideotable' and it
is used to get an insight on the status of the approval process, it has
the following data structure:

-   'hook' as 'single line text' type

-   'sailingvideotable' as 'link to another record' type

-   'isApprovedTot' as 'rollup' type

-   'isNotApprovedTot' as 'rollup' type

-   'isOngoingTot' as 'rollup' type

-   'isNewTot' as 'rollup' type

-   'Total' as 'formula' type

When the tables are ready, we can start adding videos in
'sailingvideotable.' Videos have to be attached manually by Airtable
in the attachment field and paired with a unique ID. Then you have to
write the word 'sum' in hook fields. In this way, we are creating the
rollup for 'countRowStatus.'

After uploading a list of rows with video files, we need to visit the
[API page of Airtable](https://airtable.com/%3CYOUR%20AIRTABLE%20PROJECT%20ID%3E/api/docs).
On this page, you can test the Airtable API and find the CURL links.

Appsmith allows you to import the curl link and find a Postman-like page
automatically pre-configured.

As an example, if we want to get the record inside the
'sailingvideotable', as shown below, in the section 'List record' of
Airtable API, you will find the curl link. Copy it.

![image33](https://user-images.githubusercontent.com/9484568/156807542-26b4db6e-2a88-4159-84e7-b27f56e155bd.png)


Then go back to Appsmith. In the 'datasource' section, paste the curl
link by clicking on the 'CURL Import'
button.

![image27](https://user-images.githubusercontent.com/9484568/156807652-2e9fec85-6109-4f6d-b116-3bc1f5a004fc.png)


Now you see the pasted curl link.

![image8](https://user-images.githubusercontent.com/9484568/156807778-bebba518-c564-447a-8e7a-a5fe72ae1731.png)


Once you've imported the curl link, you can go to the 'Params'
section.\
Click on 'Run' to see the API call parameters.

![image4](https://user-images.githubusercontent.com/9484568/156807825-e8cc4acd-4d51-4c94-bd95-e2869cb14f10.png)


The same can be done with the following connections used in the Video
Approval App. The table below shows the list of API calls, the call
type, what it does, and on what table it acts.

|Airtable API connection|To what Airtable table|Call type| What it does|
|:-----|:----- |:----|:----|
| get log|log|GET|Get records|
|updateStatus|sailingvideotable|PATCH|Update a record field status|
|getVideoTable|sailingvideotable|GET|Get records|
|createLog|log|POST|Post a comment|
|approve|sailingvideotable|PATCH|Update the status to approve|
|countStatus|countRowStatus|GET|Get records|
|updateDescription|sailingvideotable|PATCH|update description field|

When a video is approved, we want to create a card on the Notion
dashboard. To do this, we need a final API call that posts a card onto
the board.

|Notion Api connection|Notion page object|Call type| What it does|
|:-----|:----- |:----|:----|
| postNotionBoard|database\_id|POST|Post a card in a table viewed as board|

Let's create a page in the Notion app; [Here's an example.](https://oil-pram-286.notion.site/2011680fccdd40cf9a8634056fbd17c7?v=5ce59d1283374bdab6e71bc48a17d9c9)

Create a Board; you will see two views: 'Default view' and 'Board'

![image20](https://user-images.githubusercontent.com/9484568/156808006-fa76a79d-5e12-4a50-95b7-5dd1988e962d.png)

Notion names the fields of a table as
properties.

![image38](https://user-images.githubusercontent.com/9484568/156808089-ad6dd6ec-b864-4396-a7f1-b2e135dd541c.png)


For example, you can create four properties, with the following data
structure:

-   'Name' as 'Title' type

-   'Status' as 'Multi select' type

-   'Description' as 'text' type

-   'url' as 'URL' type

Now, find the 'database\_id' in the URL of a Notion page and save it
for later. You will need it for the Appsmith API call.

![image10](https://user-images.githubusercontent.com/9484568/156808283-b19e5900-f980-448b-9dcf-6ba49b71702e.png)


Then you should create a Notion authorization token at the [integration page](https://www.notion.so/my-integrations).

![image13](https://user-images.githubusercontent.com/9484568/156808366-1b7732f8-0b7a-461b-bddc-7068e2885371.png)


Finally, you have to enable the Notion integration app with a specific
page.

1.  Open the page you wish to link to the app, and click on the 'share'
     button.

2.  Then, click on the 'invite button' and select the integration app.

Note: If you don't use the share option, the secret token is not
authorized to see your page.

![image32](https://user-images.githubusercontent.com/9484568/156808445-1562ab2d-c41d-45ef-a004-1886543707fb.png)


When you've done the step above, you have to proceed to Appsmith.

Now go to the 'Datasources' section to create a new
API.

![image15](https://user-images.githubusercontent.com/9484568/156808703-ad4a02de-5013-4921-9741-cbaabd5b4a9c.png)


In the header section, paste the authorization token, the content type,
and the API version.

![image31](https://user-images.githubusercontent.com/9484568/156808776-00dcc271-03b7-4f74-a91d-5def4b8053b2.png)


Then in the body paste a JSON, that is the representation of the table
created in the Notion page, here's an example:

```
 {
	"parent": {
		"database_id": "<YOUR PAGE ID>"
	},
	"properties": {
		"Name": {
			"title": [{
				"text": {
					"content": "<THE CONTENT YOU WANT TO SAVE IN A NOTION CARD>"
				}
			}]
		},
		"Description": {
			"rich_text": [{
				"type": "text",
				"text": {
					"content": "<THE CONTENT YOU WANT TO SAVE IN A NOTION CARD>"
				}
			}]
		},
		"url": {
			"url": "<THE URL YOU WANT TO SAVE IN A NOTION CARD>"
		},
		"Status": {
			"multi_select": [{
				"name": "Approved"
			}]
		}
	}
}

 ```

To know more about configuring the body, check the documentation
available on Notion.

### Draw the app and make it work!


Now we start literally drawing our app.

With Appsmith, you can easily drag and drop pre-built UI elements and
quickly plug data into these widgets to your datasource and add actions
that trigger POST API requests.

You can start by sketching a mockup, for example, with PowerPoint,
including the following sections:

1. Title of the application

2. The image that explains how the workflow works

3. Pie chart with the information related to the status

4. Table with 'sailingvideotable' records

5. Section with information related to the video selected. Here the user
can update the video's description or approve the video generating a
card on Notion.

6. Where the user can change the status to ongoing or not approve and
leave comments

7. List of comments left by users

![image36](https://user-images.githubusercontent.com/9484568/156808873-91a452d0-74f0-4df4-8153-d47355f15963.png)


Now that we have decided the layout let's build the app by dragging and
dropping the widgets into the Edit page of our app.

![image12](https://user-images.githubusercontent.com/9484568/156808932-2d88b9dd-887c-43be-adfe-6ae64171e390.png)


For example, we can use the 'table' component to render Section 4 and
7 from our mockup.

To configure the components, you have to click on the gear button; on
the right side of the Edit page, a list of options will appear.

![image21](https://user-images.githubusercontent.com/9484568/156809009-7d67b46e-9fff-4065-b66b-d632437555fb.png)

If you choose the option 'Table data' , you can configure the table
specifying the name of the API created before, in this case, the
getVideoTable API.

Appsmith allows you to name the API created, and this name is a variable
that is always available on the frontend Edit page.

Then you can map the data that you need, and you will see the list of
data mapped below:

![image30](https://user-images.githubusercontent.com/9484568/156809062-b9723b5e-b774-4dd8-9bfe-e9b9bd818aa3.png)


![image24](https://user-images.githubusercontent.com/9484568/156809113-858113df-a779-43fa-b620-540cedf8a964.png)


You can decide to show the columns as you want, create new ones, and
change the column order. In this case, I decided to show only 'myid',
'Status', 'Name', 'Attachments', 'Description'.

Any row inside the shown table has a 'Selected value' property, and it
can be used to play the video in another widget if the related row is
selected. To do this, add another widget called 'player.'

![image25](https://user-images.githubusercontent.com/9484568/156809177-4235fd39-05f0-4781-b47d-1a56cc2ebf3c.png)

Now configure it using the 'selectedRow' property related to the
outgoing data coming from the table widget, where customColumn4 is the
column's name and the URL link of the video.

![image1](https://user-images.githubusercontent.com/9484568/156809240-564adb3f-f9ec-4cee-90eb-b3a2d47e5daf.png)

It is possible to show the video description inside the input widget on
the right with the same logic. The visualized text inside the input
widget matches with the table's selected row. To do this, you have to
configure the option 'Default Text,' shown in the following image.

![image5](https://user-images.githubusercontent.com/9484568/156809317-48638558-0910-4d5a-b883-f78c0d3bd201.png)

You can modify the text of the description inside the input widget.
Clicking the 'Save Description' button, you save the modified text.
![image14](https://user-images.githubusercontent.com/9484568/156809402-48dd7396-54c5-4fe4-a093-a380ef8d4a80.png)

The 'Save Description' button calls the updateDescription API to
Airtable to save the modified version in Airtable. You have to specify
it inside the 'onClick' option.

![image37](https://user-images.githubusercontent.com/9484568/156809460-451d7f7a-b345-43e7-88de-7198981d7ad1.png)



The button 'Approve' does several things:

-   Changes the status inside Airtable table 'sailingvideotable'
     (approve API).

-   Updates the Appsmith frontend (getVideoTable API).

-   Updates the status count on Airtable (countStatus API), create a
     notion card (postNotionBoard API).

Note: You must specify the related API inside the 'onClick' option, as
you see in the following image.

![image16](https://user-images.githubusercontent.com/9484568/156809508-e1302734-24ce-4ba3-854c-fabc9a8f9613.png)


To create the pie chart, use the chart widget and select the 'Pie Chart'
type.

![image6](https://user-images.githubusercontent.com/9484568/156809584-4830c855-b920-4d32-b52a-4ce9e3f39842.png)

Inside the 'Series Data' option, you have to create a readable JSON
for the pie chart with 'y' values downloaded by the relative API call
'countStatus'.

![image35](https://user-images.githubusercontent.com/9484568/156809662-adac0a3c-7f51-4bfc-9b06-5c6f835ab06e.png)


The comments section works similarly. You can change the relative status
with a dropdown menu widget when a video is selected. You can leave a
comment inside the input widget, and finally, you can trigger the API
call with the 'Send' button widget.

![image23](https://user-images.githubusercontent.com/9484568/156809721-1a5e8725-ba09-4857-a581-a3a77688c0a7.png)

The 'Send' value triggers the API calls in the following sequence:

-   update the status (updateStatus API).

-   post a log record (createLog API).

-   Get the values of the log table to see the updated values (get log
     API).

![image22](https://user-images.githubusercontent.com/9484568/156809780-44d9ec99-bd98-4b89-858c-f10ad3bb4ec6.png)


To pass values inside an API call, for example, in a post or a patch
case, you can write variables in the body of the request. These
variables are related to the frontend widget properties.

![image11](https://user-images.githubusercontent.com/9484568/156809842-edef982a-a8b6-4cc3-8a63-6cb36adf1519.png)


And that's how you can quickly build a video approval app with Notion
and Airtable!

If you're stuck anywhere,
[barozzi.giulia@gmail.com](mailto:barozzi.giulia@gmail.com)
I'll be happy to help!

This article was written as part of the Appsmith Writers Program. If
you'd like to contribute, send an email to
[writersprogram@appsmith.com](mailto:writersprogram@appsmith.com)