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.
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.
Can you please help me for this...!?
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:
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
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.
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional