Bind DataSet to a Label component

Hi I wonder if this is possible, I have a Named Queries that return 1R x 13C dataset.
This is the sample returned Data:

What I want is to bind for example the sku_code value to my Label and all other info, but I don't know how to do it.
This is what I am thinking to do it, but I know this is stupid:

I only want a specific column to point on that specific label.

Thanks and Regards,
Henjoe

To be clear: Each of the labels should receive a value from one of the columns in your dataset, right ?

Create a custom property and bind it to your query.
Now each label can bind to that dataset and pull just one of the value

It looks like you are already pulling in the dataset to the label's text property. If you're using an expression binding to do this, the binding should be written like this to pull in the individual value:

{DatasetProperty}[0, "Column Name"]

That said, it is possible that you will want to add a try() to your expression, so you'll still return a default value whenever there are no rows in the dataset.

1 Like

I actually tried this: I saw from other post,

but gives me this error:
image

I actually done it..
To give more info, this is a pop-up window.
I give custom properties of the pop-up with the ff:

data is my dataSet (as seen I think it queries successfully)
Now my problem is to pull one column of that data and bind it to specific property (like Label.text)

It strange, even though it has an error, that code works.

I imagine that the error you are seeing is being caused by the fact that there are initially no rows, so the zero index in the binding breaks. Then, the binding subsequently starts working when the row is returned by the query. The try() expression should fix that. Simply have it return a blank string when no rows are present.

For your use case, the expression binding will look like this:

try({DatasetProperty}[0, "Column Name"], "Value to return if expression fails")
2 Likes

Thanks for this!

1 Like