Button changing data displayed on another page

I want a button (on page 1) when pressed to impact what data gets displayed on another page (page 2) in the app, without navigating to that page i.e. I want the user to remain on the page with the button.

This data that is displayed is then crawled by an API and converted to markdown.

The markeddown data is sent to an AI API and the final response is displayed on the page where the button is.

Is this possible?

you’d have to save it to the database and then lookup the database on the other page

feels like a rather odd setup - could probably simplify by not using the second page and just sending the data direct to the ai api from the first page (likely via a backend workflow)

The API I’m using requires a link to a webpage to mark it down but I guess I could put all the information into the database in markdown and skip that step. Do you know how I could build this backend workflow so that the database is searched for information based on what is entered into a multiline input?

My plan is that each database entry will have key words attached to it that will be searched for.

Is the best way to build this by searching the database based on the key words and entry into the multiline input, setting a state and then using ‘result of step x’ in the next part of the workflow?

Also thanks for your help