Please provide the missing 'What text do you want to ask a question about?'

Okay, I built my automation but I get a response that I dont understand. What did i do wrong here?

And this is the error message I get:

Hi Bob,

Thanks for reaching out and the link/screenshot. The reason this error is showing up in your playbook when you try to run it is that for one of your “Get answer to the question commands” in the playbook, the text coming from the scraper which you provided to the user is coming out empty. I’ve made a playbook for you below with the proper logic for what you are looking for in your use case. I’ve left the last step empty so that you can go in and configure the “add to google sheet” action as needed on your end. I hope this helps!

Playbook: https://www.bardeen.ai/playbook/community/Scraping-www.bimhuis.nl-NEW-(troubleshooting)-QpEcpdcAEeDOEjChU9

Cheers,
Omansh

Customer Support - bardeen.ai
Knowledge Base https://www.bardeen.ai/tutorials
Explore | @bardeenai | Bardeen Community

Hey Omansh, thanks, this is great! So I had to add this step? Or did you change more?

two questions:

  1. Is this step necessary, because I need tell Bardeen to run the next steps on each element on the list that was retrieved?

  2. I didnt I had to do this in previous automations. Is this also necessary when running it in teh background? Is that the difference perhaps?

Hi Bob,

The loop command in the playbook is necessary because it helps us to iterate over every single element on the scraped list one by one and perform the necessary tasks required with that information. It just overall makes the logic far easier to understand in the playbook and makes sure that the OpenAI queries are successfully ran for every single link. I’ve added a quick “how to” on loops so you can get more familiar with them. Additionally, I changed the second scraping you were doing to “scrape data in the background”. This is because you are essentially opening the link from the first scraper in the “background” of your laptop and extracting that information. I hope this helps!

Here’s how you can set up a loop in Bardeen https://www.loom.com/share/2853363c854a40bfbd51a698b966431e

  1. Define a Trigger: Start by setting up a trigger for your Playbook. This could be a manual trigger or an event-based trigger if you’re integrating with other apps.
  2. Add Actions to Read Data: Use actions to read data from your spreadsheet. For example, you can use “Get rows from Google Sheets” to fetch rows that meet a specific condition.
  3. Set a Conditional Action: After fetching the rows, you can set a condition to check if your loop should continue. This could be based on the data fetched from the spreadsheet. If the condition is met, the loop will continue; otherwise, it will stop.
  • Initialize the Loop: After scraping the data, you’ll want to transition to processing each row individually rather than in bulk. This can be accomplished by setting up a ‘for each’ loop.
  • Loop Setup: In the loop, you’ll select each row (element) from the scraped data. Use actions like Get row from Google Sheets where you specify that each iteration should take a single row at a time. This will replace your initial bulk operation.
  • Process Each Row: Inside the loop, for each row, extract the necessary data columns as per your requirement. For instance, if you previously fetched the entire city names column, now you should adjust it to fetch the city name from the current row in each iteration.
  1. Repeat or End the Loop: Depending on the outcome of your conditional check, you can either go back to fetch new data (hence repeating the loop) or end the Playbook.
  2. Monitor and Adjust: Since Bardeen executes actions sequentially, it’s important to monitor the first few runs to ensure that the loop is performing as expected. You might need to adjust the conditions or the data handling based on real outcomes.

Cheers,
Omansh

Customer Support - bardeen.ai
Knowledge Base https://www.bardeen.ai/tutorials
Explore | @bardeenai | Bardeen Community

1 Like

thanks Omansh, sorry for keeping you busy all day with my bombardment of questions :-P. Appreciate the clear answers. Getting better at it by the minute.

Hi Omansh,
Okay, im back with a followup question. Why dont I need a “For Each Element” for this sequence of automations? Just trying to understand what the difference is.

Love to learn more!
–Bob

Hi @Bob ,

Indeed if there’s a table or a list as the source of data, Bardeen will recognize and iterate every item automatically, in other words it will “for each” them out of the box. But this means it will just send every row or list item further without looking what’s inside. This would work flawlessly if you would need to add scraped data to a google sheet which does not mind an empty cell.

Using a loop as advised by my colleague, you can target a specific element of a row and make the automation process it with a rule “for each item that exists”. This also solves the error you were getting previously.

Not related, but here is another use case. Assume you have scraped a table and you need to email it to yourself. Bardeen will iterate every row of that table, add it to the email content and send one email. But, let’s say, one column of that table is the list of recipients. In that case you can add a loop to target that list saying send email to every recipient of column x. So with “for each” in this case you send as many emails as there are recipients in column x.

I hope this helps!

Victoria,
Customer Support - bardeen.ai
Explore | @bardeenai | Bardeen Community

Thanks for the response. This is really helpful.