Help

Re: Commenting on AT Interface

1926 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

When I @mention someone on Interphase and they get an email notification to link them to the base to see the comment, is there a way to link them to the Interphase via that notification? I’m running into a bit of trouble with @mentioning someone and they’re taken to a gridview instead of the Interphase view. My gridviews and my interphase shows different fields so when they’re taken to a grid view, they don’t see the necessary information/fields.

17 Replies 17
Stephanie_Goss
4 - Data Explorer
4 - Data Explorer

+1. This is a huge challenge for my team because while they get the notification, they have to switch back to the notification main screen in airtable to see what record it might have been regarding and then go back into interface to find the record. It is a huge time suck since we comment on records a lot!

Chase_Kolozsi
4 - Data Explorer
4 - Data Explorer

Running into this issue more and more nowadays. One of the more pressing growing pains now that more of my team is relying on Airtable.

This works fine for me. The interface page that I’m using has a comment widget as part of the page. Any time that my boss leaves me a comment on a record and I click “View comment” in the notification email, it takes me straight to that record in the interface. It’s been working this way for some time (at least a month or two that I recall).

Lynne_Fetterman
5 - Automation Enthusiast
5 - Automation Enthusiast

 We are trying to work around this by adding a link to the base record in the interface for our backend team to access it quickly. However, when they comment on the back end on a record, it doesn't notify collaborators who only have interface access. Anyone find a way around this?

Good_Ink
5 - Automation Enthusiast
5 - Automation Enthusiast

We have a similar issue with comment notifications when someone is mentioned in an interface they don't have access to.

We have interface-only sales reps who do all of their work in a rep interface. The admin team is also interface-only and makes comments on orders in an admin interface. Often times, the admin team will make a comment in their interface, mentioning the rep but the rep never receives a notification because they don't have access to the admin interface.

Because this level of collaboration is crucial for orders to flow properly, I've been trying to figure out a way to force some level of notifications so the rep knows to go in and check on an order. What would be most ideal is if Airtable would allow some level of trigger to fire when a comment is made. To my knowledge, nothing (including modified time fields) fire when a comment is made.

The below is a pseudo-workaround that I haven't been able to get working due to time constraints for scripts. If anyone has advice on how to better execute this and get it working, please let me know.

1. The first automation runs on a time-based trigger and runs the below script to check the API to see if comments are present

let apiKey = 'xxxxxxxxxx'; // Replace with your API key/token
let endpoint = 'https://api.airtable.com/v0/appXXX/tblXXX?recordMetadata=commentCount';
let table = base.getTable('Orders'); // Replace with your table name

// Function to make a GET request using fetch
async function fetchData() {
  let response = await fetch(endpoint, {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${apiKey}`,
    },
  });

  if (response.ok) {
    let data = await response.json();
    let dataArray = [];
    if (data) {
      for (var i in data) {
        dataArray.push([i, data [i]]);
        }
    }

    let offset = dataArray[1][1];
    console.log(offset);
    if (offset !== undefined) {
      do {
        const api1 = await fetch(endpoint + "&offset=" + offset, {
          method: 'GET',
          headers: {
          Authorization: `Bearer ${apiKey}`,
        },
      });
        const response = await api1.json();
        for (var j in response) {
          dataArray.push([j, data [j]]);
        }
        offset = dataArray[1][1];
      } while (offset !== undefined);
    }
    for (var k in dataArray[0][1]) {
      const commentCount = dataArray[0][1][k]["commentCount"];
      const recordId = dataArray[0][1][k]["id"];
      await table.updateRecordAsync(recordId, {
            "Comment Count": commentCount,
            },
        )}
    
  } else {
    console.error('Error fetching data:', response.statusText);
  }
}

// Call the function to fetch data and update records
fetchData();

2. The second automation runs every 2 hours and checks for records with a comment count greater than 0. If there are comments, it checks a latest comment date field and sees if there is something newer. If so, it updates the date, comment text, and mentioned fields with fetched API data 

const inputConfig = input.config();
const recordIds = inputConfig.recordIds; // Replace with the actual record ID you want to monitor
console.log(recordIds.length);

const token = 'XXXX';
const baseId = 'appXXXX';
const tableId = 'tblXXXX';
const table = base.getTable("Orders");

const headers = {
  Authorization: `Bearer ${token}`,
  'Content-Type': 'application/json',
};

for (var i in recordIds) {
  const commentsEndpoint = `https://api.airtable.com/v0/${baseId}/${tableId}/${recordIds}/comments`;
  let response = await fetch(commentsEndpoint, { headers });
  let dataArray = [];
  if (response) {
    for(var i in response) {
      dataArray.push([i, response [i]]);
    }
    console.log(dataArray);
  }
}


try {
  let response = await fetch(commentsEndpoint, { headers });

  if (!response.ok) {
    throw new Error(`Request failed with status: ${response.status}`);
  }

  let data = await response.json();
  let dataArray = [];
  if (data) {
    for(var i in data) {
      dataArray.push([i, data [i]]);
    }
    console.log(dataArray);
    let commentDate = dataArray[0][1][0].createdTime; //gets the date of the latest comment
    let commentText = dataArray[0][1][0].text; //gets the text of the latest comment
    let mentioned = dataArray[0][1][0].mentioned;
    await table.updateRecordAsync(recordId, {
            "Last Comment Date": commentDate,
            "Last Comment Text": commentText,
            },
    )}

  } catch (error) {
    console.error('Error:', error.message);
}

 3. The third automation runs on a record updated trigger that watches the latest comment date field for changes and sends the comment text to the rep saying there has been comment activity on their order.

As mentioned, this is a long workaround (not working at the moment) to what seems like a relatively easy fix from Airtable to fire an event of some sort when a comment is made.

MoNasser
5 - Automation Enthusiast
5 - Automation Enthusiast

In case you guys don't already know, this issue has been fixed since late August 2023, enjoy!

Good_Ink
5 - Automation Enthusiast
5 - Automation Enthusiast

Do you have more information or release notes on this?

MoNasser
5 - Automation Enthusiast
5 - Automation Enthusiast

This should be the update related to the avove: https://support.airtable.com/docs/interface-designer-permissions

This is evident if you try it out in your interfaces with interface collaborators, it was one of the biggest pain points that our company had, but that's history now.