action compose failed

Patricia Gwee Cheng Yuan 1 Reputation point
2022-10-25T06:17:24.913+00:00

Unable to process template language expressions in action 'Compose' 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.'.
253801-image.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruno Lucas 4,436 Reputation points MVP
    2022-10-26T07:45:51.637+00:00

    Hi @Patricia Gwee Cheng Yuan

    Look like you are trying to cast a date value to an integer

    Considering the 'Reminder Date' in addDays('1899-12-30', int ('Reminder Date')) is a value like '1899-12-30' or 26/10/2022 you will get this error:

    "InvalidTemplate. Unable to process template language expressions in action 'Compose' 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.'."

    if that value is an integer, like addDays('1899-12-30', int ('1')), it would work

    If you share what you are trying to accomplish, I may be able to help.


  2. Bruno Lucas 4,436 Reputation points MVP
    2022-10-31T10:11:07.557+00:00

    Hi @Patricia Gwee Cheng Yuan
    For the date part, Excel returns epoch, so you can use this:

    value:
    if(empty(body('Get_a_row')?['dates']),null,addDays('1899-12-30',int(body('Get_a_row')?['dates']),'yyyy-MM-dd'))
    255663-image.png

    and to get current time: formatDateTime(utcNow(),'yyyy-MM-dd')

    To avoid sending email 10 times you need to move send email from the loop. if you need to pick data from all rows to build the email body, you can have something you can append to:

    https://learn.microsoft.com/en-us/answers/questions/273842/using-array-in-logic-app-sending-email-with-multip.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.