Problem with webhook
# 🤝help
b
So guys, I want to use this airtable as my KB. I follow the @quick-musician-29561 tutorial and it works perfect but ( it has like 9 values). Now that i want to put this action, I'm getting this errors
Does someone knows what this could be
I have the free suscription in Make, Idk if that has something to do with it
And free suscription in Airtable
q
@best-army-74344 🫡 Here's my earlier comment with similar problem: "If you can share your Airtable data or an example of it, we can try to build everything to work with your data (using the methods in my tutorial). So a table name, column names, a couple of rows of example data. And then also what kind of changes you want to make to it when the data needs to be updated to Botpress 💡 I think with that information we can make it work together."
b
@jolly-policeman-82775 any idea?
j
who ping me
oh
nope
no idea what this is
q
I started testing with your Airtable data.
@best-army-74344 now I have all your Airtable data in Botpress KB table
Try this, there's your Airtable data already in KB table.
code for larger data sets
Copy code
js
async function makeAsyncRequest() {
  const webhookUrl = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
// REPLACE xxxxxxxx WITH YOUR MAKE.COM WEBHOOK ADDRESS

  try {
    const response = await axios.post(webhookUrl)
    const webhookResponse = JSON.stringify(response.data)
    console.log('Log response: ' + webhookResponse)
    await deleteAllRecords()
    return webhookResponse
  } catch (error) {
    console.log(error)
  }
}

const newString = await makeAsyncRequest()
console.log("newString: " + newString)

const data = JSON.parse(newString)

await createNewRecords(data)

async function deleteAllRecords() {
  try {
    let allDeleted = false;

    while (!allDeleted) {
      const data = await Data1Table.findRecords({ selectorName: 'allRecords' });

      if (!Array.isArray(data)) {
        console.log('No records found.');
        allDeleted = true;
      } else {
        const recordIDs = data.map(record => record.id);

        if (recordIDs.length > 0) {
          await Data1Table.deleteRecords(recordIDs);
          console.log(`${recordIDs.length} records deleted.`);
        } else {
          allDeleted = true;
          console.log('All existing records have been deleted.');
        }
      }
    }
  } catch (error) {
    console.error("Error while deleting records: ", error);
  }
}

async function createNewRecords(sheetsData) {
  try {
    await Data1Table.createRecords(sheetsData)
  } catch (error) {
    console.log(error)
  }
}
@best-army-74344 also I answered to your other questions in the related tutorial 🫡
j
devmik
this is related
to make.com so why not
how can i clear a table ?
like code for botpress so if a user says something wrong and wants to start again, how do i clear the table
the sheet i mena not the table
q
Do you mean that user makes a mistake and wants to clear for example Google spreadsheet, and bot uses Make.com for that? If so, that's a great idea and I have to try that 💡 🛠️
j
yeah
he puts in his wrong email, then he wants to try again then the google sheets cleer his email
il have a look into that
wait
i have a solution for this
webhook + clear row
q
I think you solved it! 🛠️ 💎
j
works
wanna see it ?
wait
what is row number ?
lemme watch my tutorial again
works !
works perfectly !!!!!!!!!
this is the chatbot im building rn
q
🔥 🔥 🔥
b
@quick-musician-29561 you are the man bro!!!
q
🤝💯🛠️
b
I just get 10 rows of data
is workin but idk
i dont recieve all the data
@quick-musician-29561
could be my suscription plan???
q
let me check Make.com subscription plans also or I'll DM you my Make.com user name and password, if you want to try that there's already project on your name, since we have been working together with these projects exactly one month now ⚡ 🛠️ 🫡
b
If you don't have any problem with that that would be awesome. Just to check
q
I can see only these limitations: active scenarios and Ops/month
b
What I'm thinking is to use this code when the client needs to update the experiences
It will not be part of the main flow bc of that. }
Pay attention to the limit. It's very important if you are sending more than 10 rows.
2 Views