I have been working on what should be a simple canvas app for three days and I'm close to hair tearing stage (if I had any). I need to display a gallery of items from one table with a relationship to another table. I've gone through the hoops of polymorphic fields and managed to do that, but the related table contains Choice columns. When I add these columns / fields to a form (I'm using an edit form) they display the options fine, but they don't show what the currently selected option is.
So in my data I have Table 1 - 'Approvals' that links to Table 2 'Placement' via a field called 'Regarding'. when the Placement record is displayed on the edit form I can see the 'Type' field which contains 3 options and can select one, but it will not show the current selection (there will always be a current selection for this field in my data).
So far the formulas I've tried include :
ThisItem.'Job Type' (Job Type being the name of the actual choice)
AsType(Gallery1.Selected.Regarding, Placements).'Job Type'
AsType(Gallery1.Selected.Regarding, Placments).'Job Type'.Value
Choices('Job Type', AsType(Gallery1.Selected.Regarding, Placements).Type)
I've also watched Shane Young's video of working with Choices here : PowerApps Common Data Service Dataverse Option Sets - Create, Filter, Patch, and More - YouTube about a hundred times but Canvas seems to behave completely differently to the way it's behaving for me (that is, what appears to be the same reference e.g. Choices('Job Type') just does not work!)
None of which seem to even hint at my heading in the right direction.
Any help anyone can give me on this would be super valuable.
Hi @Serviced2000 ,
What's the Items property of your editform?
Do your edit form connect to Table1, and the chocie column which is called "Type" is in the Table2?
Could you please provide some screenshots to help us understand your issue better?
Besides, check if this article is useful to your issue:
Here is a screenshot of the editform with the Item property. The highlighted field is a choice field on the placement form, but doesn't populate when the item is selected (although the options are available).
Here is the 'Type' Item setting
And here is the choice option
Although it looks slightly different in the placement record...
So it many be a simple naming issue, but I would have expected the Choices('Job Type') item selection to work as that is the Choice item.
Hi @Serviced2000 ,
I still cannot understand. Seems this issue is not related to the relationship between your two tables.
So do you mean the selected value cannot be saved into your table2? Or do you mean when edit a record(like click one record from the gallery), this Type field does not show(if yes, try to set this dropdown control's DefaultSelectedItems property to "Parent.Default")?
I did a test on my side, and the Type field shows well when selecting an option through the dropdown:
That's right, when I select an item from the gallery, the already selected option (from the CDS) record does not show in the dropdown window. I'll try the Parent.Default setting you suggested.
Ok, so this control doesn't have a DefaultSelectedItems property so I tried to set the Default value to Parent.Default. That didn't work either so I tried to set it to ThisItem.Type - still comes up blank. What I want is for the type that is in the CDS record to be reflected in the form when the record is selected from the Gallery. Like other items in this screenshot.
What about removing this datacard and re-add this column? Seems that you don't do any changes of this column/datacard.
Besides, I notice an error on your screenshot, click it and check the detailed error message.
Check out the News & Announcements to learn more.
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Check out our new Discover Your Career Path blog post series and get all the details.