I am Working on a Power App, where I am filtering the records from a Dataverse table, Called MSO, and that data is coming to the Table based on the Power Automate flow which is running in the back end and fetching the records from the SQL DW.
Now the Problem is like I am getting the duplicate WebOrders and now there is a issue of Duplicate records and I need to Avoid it and make sure the WebOrders coming from the table are Unique.
// Gallery Items Property
ForAll(
GroupBy(
Filter(
'Business Service Orders',
!('BGM Status' = 3 || 'BGM Status' = 4) &&
!('Status' = 5 || 'Status' = 6 || 'Status' = 7 || 'Status' = 8) &&
'Service Type' = "TRNSPRT" &&
!IsBlank(Quantity)
),
"b2b_documentno",
"GroupedRows"
),
First(GroupedRows)
)
// Qty/Pkg Label
Concatenate(
Text(First(ThisItem.GroupedRows).Quantity),
"/",
Text(First(ThisItem.GroupedRows).Total_Number_of_Packages)
)
// Date Label
Text(First(ThisItem.GroupedRows).Date, "dd/mm/yyyy")
// WebOrder No Label
ThisItem.b2b_documentno
When I am using the Group by, I will be facing a delegation issue, in the long term, SO now I need to come up with the Solution to make sure i won't be facing any issues in the future. Especially after going to Production or Live, so please help me out with the Suggestions and on how to Proceed further on this. Below is the Current Logic I am using in the Gallery items property.
Current Code I am Using:
SortByColumns(
Filter(
'Master Service Orders',
!('BGM Status' = 3 || 'BGM Status' = 4) &&
!('Status' = 5 || 'Status' = 6 || 'Status' = 7 || 'Status' = 8) &&
'Service Type' = "TRNSPRT" &&
!IsBlank(Quantity)
),
"b2b_documentno",
SortOrder.Descending
)
The status above refers to the Dataverse choice Columns, each Choice refers to the Number and those numbers i took directly as a reference.
Please help me out on this issue. Thank you