How can I sort rows in Google Sheet (or the native table)?

Here’s what I need.

I have a Google Sheet with rows (number, blog topic and URL). Each URL links to one of my blog’s posts.

I want the flow to sort one line each day and publish a post in Linkedin and Facebook. I use Gemini to “sort the line” but I can’t find a way to sort the line inside the sheet and return only the URL of that post.

I want (in the next step) to make Gemini read the URL and write the Linkedin/Facebook post using it as a reference. Any ideas?

  1. Sorting and Selecting a Row per Day
    Activepieces and Google Sheets don’t natively support in-place sorting of rows as part of the trigger/action.

Workaround: Use Activepieces “Find Row,” “Get Row by Index,” or fetch all rows and sort/filter in a code step, then pick the row for today.

If you want to always take the next row (e.g., for “one per day”), use a separate “Processed” column or remove already posted rows, so the next day, the correct row is at the top.

  1. Returning Only the URL
    After fetching the row you want, you can extract the URL column value in a later step, and pass only that field to Gemini (or any AI step).

Typical flow:
Get/fetch the Google Sheet rows.
Sort or filter in a code step (if needed).
Extract just the URL.

Pass URL to Gemini for summarization/post generation.

  1. Generate Social Content with Gemini
    Feed the selected URL to Gemini.
    Use Gemini’s AI to generate custom LinkedIn and Facebook post content.

  2. Publish to LinkedIn & Facebook
    Use their respective “Post”/API actions with the content from Gemini.

To automate the “one per day” part, schedule your flow to run on a daily timer, fetch today’s row, and process it.

:blush: