How do I include table header when inserting filtered data from google sheets into openai as a text chunk?

How do I include table header when inserting filtered data from google sheets into openai as a text chunk?

I have this table on google sheets. I want to filter the rows based on dates and pass them to openai for prompting.


image

The data i want to send in needs to contain table header followed by the filtered rows but somehow, am only able to pass only the filtered rows without header or the entire table.

How do I include table header when inserting filtered data from google sheets into openai as a text chunk?

Hi Josh, nice to see another fellow Singaporean using Make. Welcome to the Make community!

You can use another Sheets module “Get range values” to get the header values in row 1.

Example:

Screenshot_2024-02-16_160225

Output:

Screenshot_2024-02-16_160235

Then, you can join them like this

Screenshot_2024-02-16_160223

Screenshot_2024-02-16_160246

3 Likes

Hey Sam,
How did you deduce that?
Thanks for the replies.

How do I string it up with the rest of the filtered rows?

I don’t know. Perhaps you can learn more about Make?

Links

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

Simply insert something like this before the rest of your data, expanding it to more columns as necessary.

Screenshot_2024-02-16_160223

2 Likes


Thanks. I now have 2 seperate flows.
1 to get header, 1 to get the filtered rows.

Whats the best way to loop through them and combine the data to be passed into openai api?

You can do it linearly.

If you want multiple routes, see “Router Magic Formula” link in my previous post.

3 Likes