How to include reference database field in text field?

Question:
I am using the following piece of code to include textdata from 2 database fields in a text field. This which works perfectly if the “itinerary” field would be a text field. In this case, it’s a reference field so I think I need to adjust the code. Does anybody have any idea on how to achieve this? Thanks!! :pray: :pray: :slight_smile: :slight_smile:

$w.onReady( () => { 
$w("#dynamicDataset").onReady( () => {
 let itinerary= $w("#dynamicDataset").getCurrentItem().itinerary;//text is the field you want to get its text
 let title= $w("#dynamicDataset").getCurrentItem().title;
 $w("#text19").text = itinerary + " / " + title ; 
  } );
   } ); 

Product:
Editor X

let dynamicDataset = "#dynamicDataset";

$w.onReady(()=> { 
	$w(dynamicDataset).onReady(()=> {
		let currentItem = $w(dynamicDataset).getCurrentItem();
		let id = currentItem._id; console.log('ID: ', id);
		let title = currentItem.title; console.log('TITLE: ', title);
		let itinerary = currentItem.itinerary; console.log('Itinerary: ', itinerary);

		
	});
});

Run that one and take a look, what do you get for → ITINERARY in the logs of → (CONSOLE)