cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TM3K
Frequent Visitor

Flow expressions is invalid - !empty() - Syntax checker?

Hey guys

 

I am currently working on an App which updates a SP list and creates a Planner Task via a flow. Once the SP list is updated, it triggers another flow as depicted below:

 

TM3K_0-1624251745321.png

If my variable trial IsCompleted is true, then Progress = "Completed". The flow works absolutely fine.

 

Now, I want to add another if() function which checks whether both the Due Date Time and Start Date Time are empty:

 

If(variables('IsCompleted'),'Completed',If(!empty(triggerOutputs()?['body/TrialEndDate']) && !empty(triggerOutputs()?['body/TrialStartDate']),'Not Started','In Progress'))

However, the expression is invalid.

 

Any ideas what I am doing wrong here?

 

P.S. Is there a syntax checker for the same? How do you check whether the syntax is correct?

 

Thanks

Thomas

 

 

 
2 ACCEPTED SOLUTIONS

Accepted Solutions
ganeshsanap
Super User
Super User

@TM3K Try using this:

 

If(variables('IsCompleted'), 'Completed', If(and(not(empty(triggerOutputs()?['body/TrialEndDate'])), not(empty(triggerOutputs()?['body/TrialStartDate']))), 'Not Started', 'In Progress'))

 

I am not sure if there is any syntax checker for formulas, But if you have any problem with flow you can see that in Flow checker at the top of page.


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

 

Best Regards,

Ganesh Sanap

Blog site 

View solution in original post

gabibalaban
Super User II
Super User II

@TM3K ,

PowerAutomate don't have the same syntax as PowerApps.

There are different operators for Not and And.

Please check this formula:

If(
    variables('IsCompleted'),
    'Completed',
    If(
      and(
         not(empty(triggerOutputs()?['body/TrialEndDate'])),
         not(empty(triggerOutputs()?['body/TrialStartDate']))
      ),
      'Not Started',
      'In Progress'
    )
)

Hope it helps ! 

View solution in original post

4 REPLIES 4
ganeshsanap
Super User
Super User

@TM3K Try using this:

 

If(variables('IsCompleted'), 'Completed', If(and(not(empty(triggerOutputs()?['body/TrialEndDate'])), not(empty(triggerOutputs()?['body/TrialStartDate']))), 'Not Started', 'In Progress'))

 

I am not sure if there is any syntax checker for formulas, But if you have any problem with flow you can see that in Flow checker at the top of page.


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

 

Best Regards,

Ganesh Sanap

Blog site 

View solution in original post

gabibalaban
Super User II
Super User II

@TM3K ,

PowerAutomate don't have the same syntax as PowerApps.

There are different operators for Not and And.

Please check this formula:

If(
    variables('IsCompleted'),
    'Completed',
    If(
      and(
         not(empty(triggerOutputs()?['body/TrialEndDate'])),
         not(empty(triggerOutputs()?['body/TrialStartDate']))
      ),
      'Not Started',
      'In Progress'
    )
)

Hope it helps ! 

View solution in original post

TM3K
Frequent Visitor

@ganeshsanap Many thanks! I knew it was quite easy....

TM3K
Frequent Visitor

@gabibalaban Many thanks. Helped and works!

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,246)