Hi @Li, York,
Please follow the below steps to achieve your requirement:
- Create a "Product" list. In this example, "Product Family" and "Product Name" columns are all text columns. Select the "Product Family" column and check "Group by Product Family".
- Create a "Product Family" list. Record Product Family in the Title column and create a "Product Name" text column. Keep the Product Name with blank temporarily.
- Create your main list which is named as "T" in this example. Create look up fields "Product Family"(looks up to "Title" column of the "Product Family" list), "Product Name"(looks up to "Product" list and you need to check "Product Family" column to add an additional column).
- Go to "Product" list and click on a heading so the list only shows the heading. Then copy the URL and move the "FilterValue1=" to the end of the URL. Navigate to the "Product Family" list. Click on the "Product Name" column header and select "Column settings" and "Format this Column" in order to show the Column formatting screen. Finally, paste the URL into the JSON formatting (see code below). Remove the last value, ("A") so the $Title field is used instead of the static value. Paste in your custom edited JSON and press Save.
{ "$schema": "https://columnformatting.sharepointpnp.com/columnFormattingSchema.json", "elmType": "div",
"style": {
"display": "inline-block",
"padding": "10px 0 10px 0",
"min-height": "auto" },
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 10px 0 0"
},
"attributes": {
"iconName": "Forward"
}
},
{
"elmType": "a",
"txtContent": "Show Countries",
"attributes": {
"target": "_top",
"href": {
"operator": "+",
"operands": [
"INSERT_URL_HERE",
"[$Title]",
"&FilterType1=Lookup"
]
}
}
}
]
}
- Go to "T" list and select "Customize forms". In Power Apps, select the "Product Name" card and under the Advanced tab select "Unlock to change properties" to open up for edits. Depending on your specific instance the given names for components may be different, so adjust accordingly. Select the DataCardValue3 (Combo Box) in the Product Name_DataCard1 (Card), and select the Items function value. Using the Filter function and the in operator we now can reference the values based in the Id from the Product Name to show the proper Title value based on the selection of the Product Family.
Filter(Choices([@T].ProductName), Id in Filter(Choices([@T].'Product Name:Product Family'), Value = DataCardValue2.Selected.Value).Id)
Test result in this example:
Hope my answer helps. Please let me know if you still have any concern.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.