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

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Answered

Compose if

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

 

I'm trying to do a compose where i get the current date in format yyyyMM and then depending on the day i do a if.

 

If dd < 10 i want to subtract 1 to the compose with yyyyMM if not I stay with the compose.

 

all okay with the first two composes, the issue is at the if statement because it says that the expression is invalida. someone to help me?

 

Compor: int(formatDateTime(utcNow(),'yyyyMM')) i get it in integer to do the subtraction later

Compor_2: int(formatDateTime(utcNow(),'dd'))

Compor_3: if(outputs('Compor_2')<10,add(outputs('Compor'),-1),outputs('Compor'))

 

I've already tried the statement add isolated and it works so I think probably the issue is with the outputs inside a if statement or maybe the '<10'

 

thanks in advance,

 

Miguel Teixeira

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you update the expression as:

     

    if(less(outputs('Compor_2'),10),add(outputs('Compor'),-1),outputs('Compor'))

     

    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!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Perfect! It worked! thanks a lot

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard