
Hi all,
I have an app basted on CDS database with the CASE entity and I need your help with writing the right formula.
Our service desk are working with the CASE entity and save new cases one by one every day. This is of course linked with a relationship to every customer.
My question is: I want to create a screen that ONLY displays the cases that are created for one specific Customer? Meaning, I want to filter the CASE entity to just show the cases that are saved under a specific customer relation name.
Please help
Hi @gog,
Could you please share more details about the lookup field of the customer?
Lookup fields under Common Data Service currently is only available to display the Id field of the lookup entity, it is not available for PowerApps to display/work with other lookup fields.
To workaround your secnario, please try the steps below (here we take use of the Current Contact field as an example):
1. Add a dropdown control, specify the items property to:
Distinct(AddColumns(Case,"ContactId",CurrentContact.ContactId),ContactId)
2. Add a label contorl, Add the Contact entity as an available data source, then specify the Text property of the label control with the formula below:
LookUp(Contact,ContactId=Dropdown1.Selected.Value,FullName)
3. Specify the Gallery control with the formula below:
Filter(Case,CurrentContact.ContactId=Dropdown1.Selected.Value)
Doing this should be able to filter the Gallery with the Contact selected from the Drodown control.
Note: There would be delegation issue as the filter here involved the Lookup fields.
Reference:
Regards,
Michael