Hi All,
I have 2 lists named Projects and Product_Suites.
- The Projects list contain Name, Description and ofcourse an ID column.
- In the Product_Suites list, I have linked the Projects list columns as LookUp columns. The main LookUp column ProjectID displays the ID of the Projects list (Since its a main lookup column, when clicking an ID of ProjectID lookup column, it will navigate to the corresponding record of the Projects list.
In PowerApps, I have an EditForm for the Product_Suites list. I have set the DisplayMode of the ProjectID_DataCard as View because the end user won't be able to set the ProjectID as it will display the ID only and not the name.
So, I have added a custom data card (ProjectName_DataCard) in which I have used a ComboBox to display the Project name values.
So when a user selects a Project name in the custom ProjectName_DataCard, I want to update the Selected Item of the ComboBox present in the ProjectID_DataCard. So that when Submiting the form, the ProjectID will be updated in the SharePoint.
Items property of ProjIDComboBox in the ProjectID_DataCard: This code was automatically set when EditForm is created.
Choices([@Product_Suites].ProjectID)
Items property of the ComboBox1 in the custom ProjectName_DataCard: The Projects list only contains all the Project names.
Projects.'Name (Title)'
I have tried to set the DefaultSelectedItems property of the ComboBox in the ProjectID_DataCard as below code.
Since the ProjectID is a LookUp column in the SharePoint list and it links to the corresponding record of the Projects list, the return type is of a record, hence I passed the corresponding record in the code that I tried below.
If(
ComboBox1.Selected.'Name (Title)' in Projects.'Name (Title)',
LookUp(
Projects,
'Name (Title)' = ComboBox1.Selected.'Name (Title)'
),
Parent.Default
)
But the ProjectID is not getting updated in the ProjIDComboBox.
So can anyone let me know how to set the ProjectID based on the selection in the ComboBox1 of the custom ProjectName_DataCard?