Populating Power Table from a custom dataset property

Apologies for the somewhat remedial question. I have a project I'm working on where I need to populate a table with all available stations from a database query, then have a boolean/checkbox next to each one to display to the user select which stations will be used based on a selected configuration.

I have two custom dataset properties, one which populates all available stations, and the other which provides an ordered list of station id's from the selected table. Here's where I'm having trouble

how do I populate a power table from each dataset? I assume it is through an expression binding but I'm only familiar with using these to populate a single value, not write to a table. Here I need to be able to join two datasets to each other to have one calculated column (the one displays whether the station in the row is part of the selected configuraiton)

For Reference:
Property AllStationsForLine
Columns: StationName, StationTypeId, StationPrefix

Property SelectedConfig
Columns: ConfigId,ProcessOrder,StationTypeId

Desired Powertable: all stations from AllStationsForLine as rows
Columns: Boolean "Used", StationPrefix,StationName,

Sounds like a job for the Integration Toolkit Module's leftJoin() expression function.

:grin:

1 Like

Thanks Phil! I ended up solving my problem by creating a property change script which listens for a change in the config table. The script then uses your integration toolkit to left join the station ids from the configuration to AllStations dataset. From here the script just compiles the resulting dataset and pushes it to another custom dataset property. Last step was to just bind the data property of my power table to the result table built by my script.

I do wish power tables had the ability to natively host a combination of SQL and Calculated columns without the need to build intermediate tables and event scripts, but its not the end of the world

Lastly, thanks for the tip on the module. I originally built the script without it and had to dissect the datasets manually and run loop to compare each value in my dataset. While that may be something I'd ask a newer engineer or intern to do for the learning experience its for sure not something I want to maintain within our codebase.