Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Not able to get compose condition

(0) ShareShare
ReportReport
Posted on by 4

Trying to create flow for automated birthday wishes email from Excel to power automate but condition of compose is not getting true for date format.

Condition gave as :-

Compose 1:-DOB (attach path from excel)

Compose 2:-addDays('1899-12-30',int(outputs('Compose')),'dd-MM-yyyy')

Compose 3:-formatDateTime(utcNow(),'dd-MM')

Apply Condition:- Output of compose 2 is equal to Output of compose 3.

Error at compose 2:-InvalidTemplate. Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

Error at compose 3:- ActionConditionFailed. The execution of template action 'Compose_3' is skipped: the 'runAfter' condition for action 'Compose_2' is not satisfied. Expected status values 'Succeeded' and actual value 'Failed'.

Error at Condition:- ActionConditionFailed. The execution of template action 'Condition' is skipped: the 'runAfter' condition for action 'Compose_3' is not satisfied. Expected status values 'Succeeded' and actual value 'Skipped'.

Error Details:-

Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 Please help me out.

  • RA7 Profile Picture
    4 on at
    Re: Not able to get compose condition

    I used your suggestion in my condition, but my condition is not working well.

    Compose: - Date of Birth (DOB) from Excel sheet values we are fetching values.   

    Compose2: - addDays('1899-12-30',100,'dd-MM')

    Here 100 value I used instead of int. 

    [ addDays('1899-12-30',int(outputs('Compose')),'dd-MM-yyyy') This condition used before where I was getting error as mentioned above]

    Compose3: -  formatDateTime(utcNow(),'dd-MM'

    Condition: - Output('Compose2') is equal to Output('Compose3')

    Here its showing flow ran successfully but expected output is not getting generated.

    RA7_0-1673946803867.pngRA7_1-1673946855331.png

    Can you please help me for this...!? 

  • David_MA Profile Picture
    10,607 Super User 2025 Season 1 on at
    Re: Not able to get compose condition

    I don't understand what you are trying to accomplish, so hopefully someone else will have an idea for you. However, an integer is a whole number. If you are using the result from your Compose 1 in Compose 2, the result of Compose 1 is a date. A date is not a whole number. If DOB is not date of birth, what does DOB represent? Also, what do you mean by attaching a path from Excel in reference to Compose 1? If you are referring to a file path, that is not an integer either.

     

    If you look closely at the error message you posted, "'The template language function 'int' was invoked with a parameter that is not valid.", it is telling you what you are doing is not returning an integer ('int') when that is what it is expecting.

     

    Whatever you are trying to do in Compose 1, it needs to return an integer (1, 2, 3, 4, 5, 6, etc.) as shown in my original response where I used the number 100. I created a quick button flow with a start variable of a number to represent int(outputs('Compose') in your Compose 2 and modified my expression, so it formats it as a date as you have it in your Compose 2. Is there a purpose to using December 30, 1899, in your Compose 2?

    addDays('1899-12-30',triggerBody()['number'],'yyyy-MM-dd')

    Present the manual trigger is your Compose 1:

    David_MA_0-1673723573356.png

     

  • RA7 Profile Picture
    4 on at
    Re: Not able to get compose condition

    Sorry I didn't get you point of integer could you help me with condition 

    In 2nd condition, what I have used in expression is taking integer value from compose i.e., DOB from Excel 

    which means its comparing left-hand side and right-hand side condition so can you help me with condition expression 

  • David_MA Profile Picture
    10,607 Super User 2025 Season 1 on at
    Re: Not able to get compose condition

    Your Compose 2 is invalid. You are returning a date and not an integer. Your second compose is expecting something like this:

    addDays('1899-12-30',100)

    The above returns 1900-04-09T00:00:00.0000000. Whatever compose you are using in your second compose, it needs to generate an integer.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow