cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tofifi
Helper II
Helper II

Condition control issue

Hi 

I have problem with condition issue. I'm taking dates from the excel sheet but some of the rows are empty, so i thought i will use condition 

Tofifi_0-1612268138363.png

so when the date have '2021' it should go on the left and if it's not it should go to the right, but it goes all the time on the right.

Am i doing something wrong? 

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Super User II
Super User II

Hi @Tofifi 

 

Does the date field only contain the year? Otherwise you want to check if it "contains" 2021 and not if it's the same as 2021.

 

I would recommend the following to check if a field is empty:

1. you can use null in a expression on the right side

2. use length(<Replace this with the date field>) on the left is greater than 0

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

5 REPLIES 5
manuelstgomes
Super User II
Super User II

Hi @Tofifi 

 

Does the date field only contain the year? Otherwise you want to check if it "contains" 2021 and not if it's the same as 2021.

 

I would recommend the following to check if a field is empty:

1. you can use null in a expression on the right side

2. use length(<Replace this with the date field>) on the left is greater than 0

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

@manuelstgomes  This contains also day and month. I used second option and it worked!

Thank you

@Tofifi 

Use on the left brach:

   formatDateTime(date,'yyyy') (where date is the formula shown when you hover over your actual formula)

gabibalaban_0-1612272512969.png

 

and on the right:

    string('2021'). 

Both formula should be written in dynamic content - expression. 

Hope it helps !

Tofifi
Helper II
Helper II

Hi @manuelstgomes 

 

I was using the solution you gave me and it was working great, but suddenly it stopped. Got this error:

Tofifi_0-1618906277501.png

do you know how can i fix this?

 

manuelstgomes
Super User II
Super User II

Hi @Tofifi 

 

The length function is getting a null value and it can't deal with it.

 

Can you please share the Flow that you have so that we can fix it?

 

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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