In this article, I will explain how to manage and set up the tracking number of a product return in Airtable. We will use scripting app and automation to achieve this. Let's assume you receive a form from the customer regarding the item they want to return. Then you approve the form to continue the replacement process. Here you need a tracking number So that you can track the return's progress and also update the customer with all the necessary details.
Let's start by creating a table called 'Tracking Number' in Airtable, you can call it whatever you want. Now this table will contain the data once the product return request is generated. You can link this table to other tables like the customer's table and the product's table. You can use lookups wherever necessary. You can create new columns and select 'link records' or 'lookups' to connect your table with other tables.
Now, In the next step, we will create a scripting app connection. For this, you need to go to extensions and search for 'scripting app' and install it. then create a column on your forms table where you receive product return requests. It should be a button, and this button should be linked with the scripting app that you have installed. Now, Open the scripting app and copy and paste the below code. This code will create an empty record in our 'Tracking Number' table with a unique ID which you can use to track the return progress. Based on the requirements you can modify the script to link this newly created record with other tables. For now, I am considering that you have enough knowledge to connect tables through a scripting app. If you don't know how to do that, we can help you, Feel free to contact us for consulting. You can modify the script and generate the ID based on the requirements like, the combination of numbers or names of customers, etc.
let table = base.getTable('Tracking Number')
let uniqueID = await generateUniqueString()
async function generateUniqueString() {
const timestamp = Date.now().toString(36);
const randomStr = Math.random().toString(36).substring(2, 8);
return `${timestamp}-${randomStr}`;
}
await table.createRecordAsync(
{
'Tracking Number': uniqueID
}
)
Now, you will have to setup an automation. This automation will get triggered when the new record is created in 'Tracking Number' table. The job of this automation will be to automatically send emails to customers with all the information which you would like to send including the tracking number. To Set automation click on the 'automation' on the top row. Then as shown in the below image, set your automation.
In these last steps, you need to insert the recipient of the email, subject, message (including the unique tracking number), and, if exist, any attachments.
By following these steps, you will have a unique tracking number in your database, linked to the specific item, and your customer will have all the information they need.
If you face any issues and you need a professional's help, Feel free to contact us for consulting by clicking here