question

JunTingHo-0477 avatar image
0 Votes"
JunTingHo-0477 asked shashishailaj commented

Solved: Azure Logic Apps to D365 F&O flow results in different data type in D365 compared to Logic Apps

My team is trying to use Azure Logic Apps to List Items Present in a Table in Dynamics 365 Finance & Operations using filterQuery. However, for some of the filter queries, we encounter errors where the data type in D365 is different from the one in Logic Apps, resulting in incompatible types. The fields throwing errors have data types in D365 "enum" and "bool" respectively. Is there a simple way to resolve this error?

77776-20210315-microsoftteams-image-redacted.png77777-20210315-microsoftteams-image-1.png


azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeoErlandsson avatar image
1 Vote"
LeoErlandsson answered MariaLee-4338 edited

Hi,

Some people are reporting success on filtering on Microsoft.Dynamics.DataEntities.NoYes columns.

Could you please provide what your query looks like?

I've seen some reporting that e.g. Column eq 1 works.
And some reporting that e.g.
Column eq Microsoft.Dynamics.DataEntities.NoYes’Yes’

works.

Please see:
https://erpcoder.blog/2021/02/08/filter-on-noyes-field-in-dynamics-365-flow-connector/


Br,
Leo


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @LeoErlandsson , thank you so much for reaching out with your suggestion and I will give it a go.

For more context, our current requirement is that the filterquery is dynamic , so what I am doing is appending continuously all required filters to a string in such a manner using a loop:
77816-capture.png
I'm currently trying to think of a way to append the syntax in the image above such that the Microsoft.Dynamics.DataEntities.NoYes requirement (for bool values) and Microsoft.Dynamics.DataEntities.<fieldName> requirements can be passed through the Filter Query for D365.

Please let me know if you have a better solution, thanks!

Edit: It works and the problem has been solved, thank you very much


0 Votes 0 ·
capture.png (7.8 KiB)

@MariaLee-4338 The above looks good.

1 Vote 1 ·
MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT commented

Hi @JunTingHo-0477

As per the error message looks like your filter query has a filter on the column of Microsoft.Dynamics.DataEntities.NoYes type and another column of string type.
You cannot filter on the NoYes type as per the error message. As per the connector action, List items present in table the ODATA filter query restricts the entries returned (e.g. stringColumn eq 'string' OR numberColumn lt 123).

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MayankBargali-MSFT

I am @JunTingHo-0477 's teammate. I would like to ask, in that case, is there a method to accomplish either:
(a) data conversion from edm.string to Microsoft.Dynamics.DataEntities.NoYes, or
(b) any other workaround that I could take in the edm.string into the filter query such that I would bypass the error message shown above?

Thank you!

0 Votes 0 ·

@MariaLee-4338 Thanks for sharing the details.
You need to filter with 'yourcolumn' eq Microsoft.Dynamics.DataEntities.NoYes'yourvaluecomparion No or Yes'

0 Votes 0 ·