web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Condition issue to cha...
Power Automate
Answered

Condition issue to change choice column

(0) ShareShare
ReportReport
Posted on by 43

I have a flow that was working for a previous scope of a project I am working on but now my library will contain documents that don't have expiration dates because some contracts don't expire. So I have had to add a tag that says 'No Expiry', the rest of the flow still works but I am a little confused on what I should add for my conditional statement so if the field is empty to update the tag to 'No Expiry', when I type in null or false I get a blank ExpiryDate API error.

 

The flow is used to take the expiration date and assign a tag to the documents, but like I said if there's not expiration date how do I go about assigning the proper tag, as in what expression do I use?

 

Screenshot 2024-06-05 104826.png

 

 

Categories:
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @LoganJamieson ,

     

    How do you enter the null? It should be in expression.

    vmengmlimsft_0-1717639186993.png

    If above doesn't work, please show some screenshots about the error.

     

     

    Best regards,

    Rimmon

  • LoganJamieson Profile Picture
    43 on at

    @v-mengmli-msft 

     

    Hey!

     

    I am writing the null condition exactly like the screenshot I posted and I have also tried writing it like this:

     

    Screenshot 2024-06-06 090254.pngScreenshot 2024-06-06 090128.png

     

    The expression in the above screenshot is: empty(triggerOutputs()?['body/DateOfExpiry'])

     

    When I remove the condition for the empty fields everything works normally, but once I re-add it I get errors such as the red screenshot. For each of reading incase the text is too small it says:

     

    Action 'If_DoE_is_great_than_today_=_Active' failed: Unable to process template language expressions for action 'If_DoE_is_great_than_today_=_Active' at line '0' and column '0': 'The template language function 'greater' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @LoganJamieson ,

     

    Your empty expression looks nice, the error is about previous condition.

    As the DateofExpiry maybe null value, you need to make sure compared value in "greater than" and "less than" is not null.

    I recommend you add a condition outside the "greater than" and "less than" which checks if the value is null.

    vmengmlimsft_0-1717726430120.png

     

     

     

    Best regards,

    Rimmon

  • LoganJamieson Profile Picture
    43 on at

    @v-mengmli-msft 

     

    Hey, I added those in and got it working for the most part, the only issue I seem to have now is that if I run the flow, it doesn't update the choice column, so if I remove the expiry date from the column and run the flow the choice tag doesn't change to no expiry, only seems to work for newly created files.

     

    I can paste my flow in if you'd like to have a look at the overall structure.

  • Verified answer
    LoganJamieson Profile Picture
    43 on at

    I solved the issue, i'll add the finished flow here if someone ever needs to do this in the future.

     

    The issue I was doing was going one by one with conditions rather than using the true and false sections correctly, I was doing if true conditions over and over and I believe doing this just confuses the flow, it worked without the no expiration date choice but once added it broke the flow. So to work around this I first did one condition to check for null, if it wasnt null the second condition was in the if false side, and it waterfalled from the original condition statement.

     

    I'll link the broken one and the one I used to fix the issue:

     

    Screenshot 2024-06-10 120947.pngScreenshot 2024-06-10 121016.png

     

    First one was using only true statements (which didn't work with the 'No Expiry') and the second was how I changed the flow to make it less confusing and properly harness the false option.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard