Binding a Drop Down List from Custom Object in root Container in Perspective

I am calling a REST API to populate a dataset that is stored in the root container of my Perspective Page (Custom property named response).
I want to bind my drop down list (value and label) based on this data with is in a json format.

I can easily connect to a single entry but am not sure how to bind to the data list.
For Example I can use property binding to do something like this.

parent.custom.response[0].name

But obviously I only get one entry, removing the index doesn't work.

Not sure if I need to Transform the json response into a dataset, and if so how to do it.

I will also need to filter the entries and am not sure where best to do that.
Thanks in advance,
Brandon

I think a property binding followed by a script transform would be the way to go.

The property binding should point directly to the 'root' of the object, so in this case parent.custom.response.

Your script doesn't have to return a dataset, just a properly structured array of items. If you want filtering at the same time, it's easy to do. Something like:

output = []
for row in value:
	if "abc" in row.name:
		output.append({
			"value": row.value,
			"label": row.name,
		})

return output

Where the if statement is doing the filtering, and each object added to the output list has the required value and label keys.

Thanks, worked like a charm and a 2 for 1 solution. Glad I asked both questions.