How to connect accordian FAQ to database

Hey, I need help in setting up my accordion FAQ.
It is a product-specific accordion, so the questions and answers will be different according to the product opened.
I set up the front end and the database.
The front end contains an accordion with collapsing effects.
There are two databases, one is called faq, and the other one is the Product database. The screenshots are attached below.


I want to get the data from the faq database i.e the questions and answers and display that in the accordian on the specific product page opened.

The Page
Strip Elements:

  • Title Strip 1: #title1

  • Title Strip 2: #title2

  • Content Strip 1: #details1

  • Content Strip 2: #details2 (collapse on load)

​​
Add text elements and images to your title and content boxes.

Button Elements:

  • Expand Button 1: #expand1 (hide on load)

  • Expand Button 2: #expand2

  • Collapse Button 1: #collapse1

  • Collapse Button 2: #collapse2 (hide on load)

Page Code
export function expand1_click(event, $w) {
$w(‘#details1’).expand();
$w(‘#expand1’).hide();
$w(‘#collapse1’).show();
}

export function expand2_click(event, $w) {
$w(‘#details2’).expand();
$w(‘#expand2’).hide();
$w(‘#collapse2’).show();
}

export function collapse1_click(event, $w) {
$w(‘#details1’).collapse();
$w(‘#expand1’).show();
$w(‘#collapse1’).hide();
}

export function collapse2_click(event, $w) {
$w(‘#details2’).collapse();
$w(‘#expand2’).show();
$w(‘#collapse2’).hide();
}

Please help
Thank you
@russian-dima

You can use the Collapsible Sections example to see how to populate then sections.