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 / 'The template language...
Power Automate
Answered

'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'

(0) ShareShare
ReportReport
Posted on by 13

I am very knew to the power platform. I am trying to create a flow that migrates data from XLS (imported from sharepoint list) to Sharepoint online list using a work flow. When trying to create list item for a date field i keep getting error:

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

 

I read that it was tricky importing dates, so this is what i did, i have three date fields, so i initialized 3 variables, i was told to use string.

Truss79_0-1709753358073.png

 

Next i set each variable the value from the excel file (value).

Truss79_1-1709753427220.png

 

Then in my create item, i apply the expression addDays('1899-12-30',int(variables('varDate2')),'mm/dd/yyyy')

Truss79_2-1709753557643.png

 

I am assuming something about the variable cannot be set to int? I cannot figure out why. Any help would be appreciated

 

EDIT: When i look at the input, i notice that the date bing input contains the time, so i tried to remove it by updating my expression an adding int(first(split(variables(‘varDate1’), ‘.’))), but i still get the error

Truss79_0-1709755141813.png

 

 

 

Categories:
  • Verified answer
    SamLed Profile Picture
    2,340 Moderator on at

    Hi @Truss79,

     

    If you get data from excel, go into advanced options of "List rows present in a table" and select datetime ISO format:

    SamLed_0-1709759007050.png

     

     

    To remove time use DateTime function:

     

    formatDateTime(variables('varDate1'), 'MM/dd/yyyy')

     

    Remark: "mm" is format for minute "MM" for month

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

  • Truss79 Profile Picture
    13 on at

    Thanks SamLed, i read that i needed to apply a string conversion because there was issues importing Dates from Excel into SP list, that is why i applied the Variable and then i used addDays(‘1899-12-30’,int(variables(‘varDate1′)),’yyyy-MM-dd’), but it seems i didn't need to do any of that, just the DateTime Formate ISO 8601 did the trick. Thanks!

  • Truss79 Profile Picture
    13 on at

    So changing the DateTime to ISO 8601 seems to fix the issue if the field contains a value, but if its a blank (NULL) value i get this error:

     

    The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/SSC_x0020_Service_x0020_Start_x0' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.

     

     Why does the field need to have a value, this date field is not a required field so will have NULL values. 

     

    @SamLed 

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 377

#2
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 128

Last 30 days Overall leaderboard