Display database row in vertical format

Hi, I want to display a single row from a database in a vertical fashion instead of the typical table (or row) fashion. I have multiple label components on the window and I would like to assign the returned fields from the database row to each label. I assume I will be using system.db.runPrepQuery but I am not sure how to get the returned PyDataSet into the labels. Currently I am binding each labels Text property with a SQL Query but this seems highly inefficient. Any ideas?

Bring the complete dataset with a single query into a custom property of your root container, unless you already have it in a table or some other component (possibly the component that picks your row number). In each edit field/label, include a custom string component that will hold the column name. Then bind the field’s value to something liketry({Root Container.myDatasetProp}[{Root Container.myRowNumber},{Root Container.editField.myColumnName}], 0)This approach is appropriate if you know the column names in advance. Otherwise, the template repeater is the tool to use. You’d need the actual column names from your data set as rows in a new dataset (for the repeater). Try this expression with the objectScript() function from my Simulation Aids module:objectScript("system.dataset.toDataSet(['column'], [[x] for x in args[0].columnNames])", {Root Container.myDatasetProp})Make sure you get the latest version

Thanks Phil, exactly what I needed!