cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lorem1960
Resolver III
Resolver III

Not able to create items in SharePoint List from Excel sheet due to a Date field.

Created a very simple flow that first list rows present in a table, then I perform an apply to each and then finally Create Item in SharePoint list, and here I get the error listed below.

 

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

 

The EnabledUntil is a Date field (Excel) with this format: mm/dd/yyy hh:mm:ss  in my SharePoint list this column also exists and is a Date and Time type. In addition, the EnabledUntil date column does not contain any Null values.

 

okay, in the meantime in the Create Item I formatted the date EnabledUntil like this: 

if(empty(item()?['EnabledUntil']),null,addDays('1899-12-30',int(item()?['EnabledUntil']),'yyyy-MM-dd'))

 

Lorem1960_0-1632738459335.png

 

But when I run the flow again then I get this error:

 

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

 

Wonder whether is has anything to do with the time component that is part of the EnabledUntil date column in Excel

 

Lorem1960_0-1632743011215.png

If the time component in the EnabledUntil column is the culprit is there then a way to strip out hh:mm:ss from that column?

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Lorem1960
Resolver III
Resolver III

Found a way to strip out the time part of the date by using this expression:

 


if(empty(item()?['EnabledUntil']),null,addDays('1899-12-30',int(split(item()?['EnabledUntil'], '.')[0]),'yyyy-MM-dd'))

 

 

View solution in original post

2 REPLIES 2
Lorem1960
Resolver III
Resolver III

Found a way to strip out the time part of the date by using this expression:

 


if(empty(item()?['EnabledUntil']),null,addDays('1899-12-30',int(split(item()?['EnabledUntil'], '.')[0]),'yyyy-MM-dd'))

 

 

molinax
Frequent Visitor

This solution worked for me, even if I've formatted excel date and list date "dd.MM.jjjj". I really copied this formula as it is and just changed the item name.

Thanks. I have tried so many times other solutions… Now I'm quite happy as you can imagine 😄

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,620)