how to retrieve data from external database

I want to retrieve the data from external database and bind in container text element.
ROOMTYPE_ID This id given by external api on click of previous page button.
Can anyone help me to this below code:-

GetHeaderDetail ( ROOMTYPE_ID )
. then (( response ) => {
console . log ( “res” , response );
response . Header_Detail . forEach (( Header_Detail ) => data . push ( Header_Detail ));
headerDetails = data
textShow ( headerDetails )
return Promise . all ( data . map ( data => data . _id = String ( data . ROOMTYPE_ID )));
})

export function textShow ( itemdata ) {
console . log ( “itemdata1” , itemdata )
$w ( “#text8” ). text = itemdata . ROOMTYPE_DESC ;
}

YOu will need to use http-functions and fetch-method. Also generating an END-POINT will be needed.

Take a look on my own posts in my profile, and you will find the right answer.

i want to bind single text using external database