I created a PowerApp using a SharePoint list.
It has three screens the "BrowseScreen", "DetailScreen", & "EditScreen".
Depending on the "Content Type", different columns are associated with different "Content Types".
I have it setup so that the user selects the 'Content Type' on the "BrowserScreen". It filters the list there to only show records of that content type.
Then, when the user wishes to add a record by clicking the "+" symbol the selected "Content Type" gets passed to the "Edit Form".
When the variable identifying the 'Content Type' get's passed to the "Edit Form", it's used to set the default value of the dropdown. This value then changes the visibility of other fields based on whether they are in that 'Content Type'.
However, when I use the default value, the dropdown shows the correct value, but the fields don't appear to call their function within the 'Visible' property.
If I go to the dropdown and select the option, all the fields 'Visible' property code runs and shows the correct fields.
Is there a way to resolve this issue?
I am setting the 'Content Type' dropdown using the following:
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
Id: Variable1,
Value: Variable2
}
Variable 1 & 2 are passed when the user hit's the default "+" icon to add a row.
These are also set based on the dropdown in the first screen.
Fields that are not associated with the selected 'Content Type' are filtered like so within the 'Visible' option:
If(Self.DisplayName in LookUp('SharePoint List', Title=DataCardValue.Selected.Name).Columns, true, false)
Solved! Go to Solution.
Hi @negodfre
Set the Default property of the dropdown to
ContentTypeSelection.Selected.Name
In this example, I have a dropdown in the Browse screen called "ContentTypeSelection". And items property to
Choices([@SPListName].'{ContentType}')
In the Edit Screen, Set the Items property to
Same as Browse Screen
And set the default property like below as simple Text
I tested, and it works.
Thanks, Stalin (Microsoft MVP)
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos
Hi @negodfre
Change to Name like below
Thanks, Stalin (Microsoft MVP)
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos
Hi @negodfre
Set the Default property of the dropdown to
ContentTypeSelection.Selected.Name
In this example, I have a dropdown in the Browse screen called "ContentTypeSelection". And items property to
Choices([@SPListName].'{ContentType}')
In the Edit Screen, Set the Items property to
Same as Browse Screen
And set the default property like below as simple Text
I tested, and it works.
Thanks, Stalin (Microsoft MVP)
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos
When I do that, I get the 'id' of the 'Content Type'. Example '0x00012403123...' instead of "Option 1".
I don't actually get the names.
Is there a way to get the names?
Hi @negodfre
Change to Name like below
Thanks, Stalin (Microsoft MVP)
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos
Thank you!
User | Count |
---|---|
251 | |
106 | |
96 | |
50 | |
39 |