cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adeelx
Level: Powered On

unable to build a logic using D365 Finance Operation connector

Hi Community

 

i spent hours building logic to get the Batch Job data entity data using D365 FO connectore and then compare STATUS into condition control to look for record where:

1- Start date time EQUALS today's date

2- Batch Job STATUS equals error

 

and send an email if both of above are true. at one point the flow worked during test and trial for waiting batch job but for some reason the lost the last known config i saved for the flow and now i spent hours but couldnt figure out the logic which make above two conditions TRUE so that the flow goes to the O365 connector to send out an email.

 

any help will be appreciated here from community really.

 

below is what is currently configured:

1st condition

formatDateTime(items('Apply_to_each')?['OrigStartDateTime'],'MM/DD hh:mm tt'
is equals to 
formatDateTime(utcNow(),'MM/DD hh:mm tt')

 

2st condition

items('Apply_to_each')?['status']

is equals to 

contains(items('Apply_to_each')?['status'],'waiting')

 i also tried : contains(item(),'waiting') ... but no avail

 

FlowCondition.png

 

i have also confirmed that data is there coming from BatchJob data entity using D365 FO connector to make the above condition true but the expression result always comes as false that is why the flow i not moving to the nextg step of sending email. Below is the sample data from D365 onnector:

 

669075fc5777","BatchJobRecId":5637534586,"Finishing":0,"StartDateTime":"2019-07-23T22:24:30Z","EndDateTime":"2019-07-23T22:24:40Z","StartTime":0,"JobDescription":"Test to Fail","CompanyAccounts":"WA","Status":"Error","OrigStartDateTime":"2019-07-23T20:58:03Z","ExecutingBy":"svcAxAdmin","StartDate":"1900-01-

 

Please help me understand what i am doing wrong here ?

 

Thanks in advance 

 

 

 

 

 

 

5 REPLIES 5
Dual Super User
Dual Super User

Re: unable to build a logic using D365 Finance Operation connector

Hi @adeelx 

 

I think the issue exists with the second condition of yours, from what I understood, you want to check if the Status returned contains 'Waiting', instead of using the expression, you can directly use "contains" as an operator and mention the text you are looking into the right hand side box, something similar to:
kkd.png

 

 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
adeelx
Level: Powered On

Re: unable to build a logic using D365 Finance Operation connector

@yashag2255 

 

i actually tried this and and expression results always come as "False". 

 

FlowFalseExpression.png

 

this what i have as you suggested.

 

FlowFalse2.png

 

Dual Super User
Dual Super User

Re: unable to build a logic using D365 Finance Operation connector

Hi @adeelx 

 

I believe the status 'Waiting' is just a label for a value (either 0,1,2) can you do get record and check what value you are getting for the status field? Based on that you can configure the condition. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

adeelx
Level: Powered On

Re: unable to build a logic using D365 Finance Operation connector

@yashag2255 

 

i actually pasted the data above. the value is not ENUM. its coming in as string 

 

669075fc5777","BatchJobRecId":5637534586,"Finishing":0,"StartDateTime":"2019-07-23T22:24:30Z","EndDateTime":"2019-07-23T22:24:40Z","StartTime":0,"JobDescription":"Test to Fail","CompanyAccounts":"WA","Status":"Error","OrigStartDateTime":"2019-07-23T20:58:03Z","ExecutingBy":"svcAxAdmin","StartDate":"1900-01-

Dual Super User
Dual Super User

Re: unable to build a logic using D365 Finance Operation connector

Hi @adeelx 

 

The error code that is getting returned through your data is "Error", but as per flow configuration you are looking for waiting as the status. So since these values does not match hence it is giving the expression result as false.
 
If you want to check for Status Code "Error", can you try to replace "waiting" with "Error" in your expression.
 
If you are looking for something where either of the two condition is true, then you need to change the AND condition to OR.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,509)