cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nalk
Regular Visitor

Filter on dynamics 365 for operations not applying correctly

Hello,

 

I am trying to apply several filter conditions to a dynamics 365 for operations datasource withouth any success.

The issue does not seem to be on powerapps but rather on the endpoint used by it.

For instance if I use the following formula : 

 

Filter(PurchaseOrderDirectDeliveries; InputBDR.Text in SalesOrderNumber ; Retail.Selected.StoreNumber=DefaultReceivingWarehouseId)

 

The corresponding call sent to the endpoint is :

https://europe-001.azure-apim.net/apim/dynamicsax/8a490c534884d7a3b4a3ed099fd76417/datasets/{tenant}... eq '014')&$top=100

The call seems correct as an and operator is applied between the two conditions however the result returned is as follow :

 

{
  "@odata.context":"https://dynamicsaxconnectionprovider-northeurope.db3-ase-001.p.azurewebsites.net/$metadata#datasets('{tenant}.sandbox.operations.dynamics.com')/tables('PurchaseOrderDirectDeliveries')/items","value":[
    {
      "@odata.etag":"W/\"JzE2NTU1NDA5MDEsNTYzNzIzMzkwMic=\"","ItemInternalId":"7922fd61-c24d-4668-8f5f-9441d74cc6d4","DefaultReceivingSiteId":"","DeliveryModeId":"Casiers","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"C'est gratos !","DocumentStatus":"PurchaseOrder","dataAreaId":"epa","TotalAmount":5.2,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039000","DeliveryTermsId":"","DeliveryAddressName":"Mauvais Payeur","OrderVendorAccountNumber":"FESYL","DlvMode":"Casiers","Name":"Mauvais Payeur","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"EPA015","PurchaseOrderNumber":"PCFS063130","PurchaseOrderName":"SYLCLAU"
    },{
      "@odata.etag":"W/\"JzE5NDk0NDEyMDMsNTYzNzIzMzkwNCc=\"","ItemInternalId":"4751d8fa-ebf4-4e8c-9f3c-25e68d6a5063","DefaultReceivingSiteId":"","DeliveryModeId":"Ccgie","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"","DocumentStatus":"ReceiptsList","dataAreaId":"epa","TotalAmount":3.7,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039002","DeliveryTermsId":"","DeliveryAddressName":"Jeff BAUMANN","OrderVendorAccountNumber":"FESYL","DlvMode":"Ccgie","Name":"Jeff BAUMANN","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"001","PurchaseOrderNumber":"PCFS063132","PurchaseOrderName":"SYLCLAU"
    },{
      "@odata.etag":"W/\"JzU5ODkzODYzLDU2MzcyMzM5MDUn\"","ItemInternalId":"b56e3bbd-5fe7-4904-99c7-1f8357c47f07","DefaultReceivingSiteId":"","DeliveryModeId":"BatimentB","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"","DocumentStatus":"PurchaseOrder","dataAreaId":"epa","TotalAmount":5.7,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039003","DeliveryTermsId":"","DeliveryAddressName":"Alexandre VINET","OrderVendorAccountNumber":"FESYL","DlvMode":"BatimentB","Name":"Alexandre VINET","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"EPA015","PurchaseOrderNumber":"PCFS063133","PurchaseOrderName":"SYLCLAU"
    },{
      "@odata.etag":"W/\"JzYxNzU5MjcwMCw1NjM3MjMzOTA2Jw==\"","ItemInternalId":"1c0229d4-d902-4225-a20f-c3bce4fb40c5","DefaultReceivingSiteId":"","DeliveryModeId":"","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"","DocumentStatus":"PurchaseOrder","dataAreaId":"epa","TotalAmount":5.7,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039004","DeliveryTermsId":"","DeliveryAddressName":"Alexandre VINET","OrderVendorAccountNumber":"FESYL","DlvMode":"","Name":"Alexandre VINET","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"EPA015","PurchaseOrderNumber":"PCFS063134","PurchaseOrderName":"SYLCLAU"
    },{
      "@odata.etag":"W/\"Jzg5MDExOTU1MCw1NjM3MjMzOTA3Jw==\"","ItemInternalId":"671d4594-fe6f-4422-9b07-3b2403175d7b","DefaultReceivingSiteId":"","DeliveryModeId":"BatimentA","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"","DocumentStatus":"PurchaseOrder","dataAreaId":"epa","TotalAmount":11.4,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039005","DeliveryTermsId":"","DeliveryAddressName":"Alexandre VINET","OrderVendorAccountNumber":"FESYL","DlvMode":"BatimentA","Name":"Alexandre VINET","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"EPA015","PurchaseOrderNumber":"PCFS063135","PurchaseOrderName":"SYLCLAU"
    },{
      "@odata.etag":"W/\"JzE1NTA2MzEyODksNTYzNzIzMzkxMSc=\"","ItemInternalId":"8d49eb45-2f5d-4f05-8c00-9f7474e75e57","DefaultReceivingSiteId":"","DeliveryModeId":"Casiers","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"","DocumentStatus":"ReceiptsList","dataAreaId":"epa","TotalAmount":74,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039009","DeliveryTermsId":"","DeliveryAddressName":"Jay Jay  OKOCHA","OrderVendorAccountNumber":"FESYL","DlvMode":"Casiers","Name":"Jay Jay  OKOCHA","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"001","PurchaseOrderNumber":"PCFS063139","PurchaseOrderName":"SYLCLAU"
    },{
      "@odata.etag":"W/\"Jzg4NDE0OTk0OCw1NjM3MjMzOTEyJw==\"","ItemInternalId":"6a3ce496-6bdc-439e-ab4e-0a1027634634","DefaultReceivingSiteId":"001","DeliveryModeId":"Casiers","ShippingDateRequested":"1900-01-01T12:00:00Z","VendorOrderReference":"","DocumentStatus":"ReceiptsList","dataAreaId":"epa","TotalAmount":12.85,"CurrencyCode":"EUR","SalesOrderNumber":"CDE0039009","DeliveryTermsId":"","DeliveryAddressName":"Jay Jay  OKOCHA","OrderVendorAccountNumber":"COR_Bedichou_GD1","DlvMode":"Casiers","Name":"Jay Jay  OKOCHA","PurchaseOrderStatus":"Backorder","DefaultReceivingWarehouseId":"001","PurchaseOrderNumber":"PCFS063140","PurchaseOrderName":"Cordonnerie Benichou GD1"
    }
  ]
}

The condition on SalesOrderNumber has been applied but the condition on DefaultReceivingWarehouseId is not satisfied by any of the entries returned.

I have tried several other formulas:

 

Filter(PurchaseOrderDirectDeliveries; InputBDR.Text in SalesOrderNumber && Retail.Selected.StoreNumber=DefaultReceivingWarehouseId)

or

Search(Filter(PurchaseOrderDirectDeliveries;DefaultReceivingWarehouseId=Retail.Selected.StoreNumber);InputBDR.Text;"SalesOrderNumber")

But every time the only condition taken into account is the one on SalesOrderNumber.

For information if I do a single condition on DefaultReceivingWarehouseId the condition is correctly applied.

 

Thanks you in advance for your help.

 

 

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi nalk,

 

What is StoreNumber? Is it a column name?

 

It seems that you want to filter when the Id of StoreNumber is equal to DefaultReceivingWarehouseId, please try to configure it as Retail.Selected.StoreNumber.Id to see if it works.

 

Best regards,
Mabel Mao

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mabel,

 

Thank you for your answer.

 

StoreNumber is indeed the name of a column thus the filter i want to implement is having the StoreNumber equal to the DefaultReceivingWarehouseId.

 

As I mentionned, both criteria when applied alone are working as expected, it is when i try to have them both applied at the same time that I encounter an issue, but to me the expression I use in the powerapps is not the issue.

 

As far as I can see, the issue comes front the endpoint that is used by powerapps.

The standard endpoint is https://{tenant}.sandbox.operations.dynamics.com/data but powerapps seems to be using https://europe-001.azure-apim.net/apim/dynamicsax as a proxy, and this proxy is only applying one of the condition.

 

Best Regards

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,250)