I have been experimenting with Components in order to make some very useful reusable controls.
I have created a Component that is basically a Gallery of Buttons - it has input Parameters of "Items" (Single column Table of Text values) and "Default" (Text) - and an Output Parameter "Selected" (Text) to show the selected Gallery Item - This is a common pattern used to create Menu Components that can be re-used on multiple screens.
I am using 2 instances of this Component to make a Menu -> Sub-Menu arragement, with the Sub-Menu showing a filtered list of sub-menu Items that are applicable to the Selected Menu Item - (I have a Collection that describes the 1:N relationship)
Component_Instance_1.Items = ["New", "In Progress", "Complete"]
(So the Component_Instance_1.Selected will be something like "New")
RelationshipCollection = [
{Stage: "New", SubStage: "Investigating"},
{Stage: "New", SubStage: "Validating"},
{Stage: "In Progress", SubStage: "Step 1"},
{Stage: "In Progress", SubStage: "Step 2"},
.... etc
]
ComponentInstance_2.Items =
RenameColumns(
ShowColumns(
Filter(RelationshipCollection, Stage=Component_Instance_1.Selected),
"SubStage"),
"Result","Value")
You should be able to ignore the RenameColumns and ShowColumns aspect - this just turns the filtered list into a single columns of text values - plus, I have tried MANY different methods of creating this table for the SubStage component - the only issue is the Filter Formula - I am getting a Circular Reference Error, even though there is NOT any circular reference.
I believe it must be a limitation of the components functionality, as the only real reason I can think of that a circular reference is created is within the Root Component, as I am setting the "Items" input parameter to the "Selected" output parameter - even thought I am doing this accross 2 seperate instances of the component, PowerApps is throwing this circular reference error.
I have tried all sorts of workarounds, like using an intermediate textbox or label to hold the selected value of the first component instance, but when that new control is referenced in the 2nd component instance, the same circuilar reference error pops up)
Has anyone else had issues with this behaviour?
Does anyone know a viable workaround that I might not have tried yet?
Can someone from MS confirm if this is a Bug in the Components functionality?
And if So, can you let us know when it might be fixed?
Thanks in Advance.
James.