Data-set's property-set is not generated on the manifest typescript definition. What we do is add the property-set definition to the EntityRecord in componentframework typescript definition just so it will compile. Is there any way to generate property-sets inside datasets in the manifest as well?
During my investigation, I think I found out that property-set in dataset are found inside columns property. The name of one of my property was found in the first column.
It seems like a bug as columns should only contains the column of the view used by the subgrid
Yes I get it. The columns property should only contain the columns configured to the view where you applied the component. But with property-sets, I think you don't need to add columns to the view. It's specifically used for binding entity attributes to your control (eg. what field should appear as the header of each data card in a grid).
Let's use this manifest as an example:
<manifest> <control namespace="Sandbox" constructor="Sandbox" version="0.0.1" display-name-key="Sandbox_Display_Key" description-key="Sandbox_Desc_Key" control-type="standard"> <!-- dataset node represents a set of entity records on CDS; allow more than one datasets --> <data-set name="sampleDataSet" display-name-key="Dataset_Display_Key"> <property-set name="samplePropertySet" display-name-key="Property_Display_Key" description-key="Property_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" /> </data-set> <resources> <code path="index.ts" order="1"/> </resources> </control> </manifest>
My problem is, while dataset properties defined in the manifest are being generated in manifest.d.ts (you can access it thru context.parameters.sampleDataset), ts definitions for the property-sets under the dataset are not being generated. So I end up tweaking the componentframework.d.ts and add property-set definitions under the EntityRecord interface just so I can access samplePropertySet thru context.parameters.sampleDataset.records[someRecordID].samplePropertySet
What I discovered is the following. Here is the data-set part of my manifest:
<data-set name="nnRelationshipDataSet" display-name-key="nnRelationshipDataSet_Display_Key"> <!-- 'property-set' node represents a unique, configurable property that each record in the dataset must provide. --> <property-set name="displayAttribute" display-name-key="targetEntity_Display_Key" description-key="targetEntity_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" /> <!-- <property-set name="nnRelationship" display-name-key="nnRelationship_Display_Key" description-key="nnRelationship_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" /> --> </data-set>
Notice the name of the property-set => displayAttribute
Now, when I debug in the browser, and look in the columns property of my data set, here is what I can see
But columns where supposed to contains only informations about the column from the view used in the subgrid. Why the hell the alias of the first column is the name of my property-set? That's why I think there is a bug.
Or maybe only columns from the view can be bound and then, this is our job to parse columns to find which one is the one used in the property set, thanks to the alias.
A'property-set' is basically used to guarantee the needed column info could be pulled down regardless if it's on View or not. Hence, if it's on an entity homepage, it could easily switch to different views without worring about if that view contains the specific column or not.
For example, suppose a Calendar control has 3 property-sets, TaskName, StartDate, EndDate. If we bind these 3 property-sets to one entity, say 'Activity' entity, attributes 'subject', 'scheduledstart', 'scheduledend', then regardless we switched view to 'Closed Activity', 'Last Activity', 'Planed Activity', the needed 3 column metadata and data will be pulled down. Under this scenario, the view is mostly used for filtering.
Under some other scenarios, a data-set control like normal grid control still need to get all view's column and render. Hence, the 'columns' array we provided is actually the superset of both view's columns and property-set binding columns. The 'alias' in each column object is used to help dev find the mapped property-set.
Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.
Did you miss the call? Check out the Power Apps Community Call here.
We are excited to announce the Power Apps Super Users!
Check out our new profile badges recognizing authored solutions!