I need to list all the values from one of the columns in an Activepieces table. These values should be added — as a markdown list — to an AI prompt. Is there an easy/obvious way to do this?..
Any guidance would be greatly appreciated.
I need to list all the values from one of the columns in an Activepieces table. These values should be added — as a markdown list — to an AI prompt. Is there an easy/obvious way to do this?..
Any guidance would be greatly appreciated.
hi @iocouto,
You can use the Find Records piece to list all the values of a certain column.
Example table:
Find Records step:
After this step I like to just use a code piece to extract all the values. I even added a snippet for you that gives them in a markdown list:
export const code = async (inputs) => {
const columnId = inputs.columnId;
// Extract colours from each item using the dynamic column ID
const colours = inputs.colours.map(item => {
return item.cells[columnId].value;
});
// Create and return markdown list
return colours.map(colour => - ${colour}).join('\n');
};
You could probably use a loop piece as well to extract the colours, but I like to do it this way.
Entire flow:
https://cloud.activepieces.com/templates/FX5gv3fjdHSzb2daWqiXx
Thank you, @Dennis, for you help!
I tried using your code to extract the column data, but all I get in the output when I test it is this:
Error: Compilation Error index.ts(10,35):
error TS1005: ',' expected.
I’ve also worked out that I can just add the ‘Find Records’ step without any filters at all, and we get all the records on the table.
I’d love to try a no-code version you mentioned, perhaps using the ‘Loop’ step? Do you have a suggestion for how to do that?