cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Create sharepoint item with date

Hi,

 

I wish to create a sharepoint item and the field values come from excel. One of the field in excel is a date with this format "dd/mm/yyyy". However when I put the date in the sharepoint field, an error occurs. What could be the problem?

sbgoh_0-1596293697611.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Create sharepoint item with date

Hi @sbgoh ,

 

You need to make sure the column wouldn't with empty value.

And if the column would have empty value, you should check if the column is null for each row, if the column is null, you could set the default date in the new item or don't create new item for this row.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Create sharepoint item with date

When you read a date and time for excel its returned as numeric value. You can see in your screenshot the date is returned as  44048.

 

When you insert this into share point date field you will get error.

You can use thsi function to convert it back into date :

 

addDays('1899-12-30',int(items('Apply_to_each')?['DueDate']),'yyyy-MM-dd')

 

Where items('Apply_to_each')?['DueDate'] is the date variable from excel

 

You can change the format of that time as per your share point.

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,
Rahber

Highlighted
Helper V
Helper V

Re: Create sharepoint item with date

Hi, I tried but I encountered another error below. No idea why. 😞

sbgoh_0-1596362816832.png

 

Highlighted
Community Support
Community Support

Re: Create sharepoint item with date

Hi @sbgoh ,

 

Could you please share the screenshot of the excel table?

Could you please share the screenshot of the configuration and the run history of the flow?

Please make sure that date in your excel table would only contains the date, it shouldn't contains the time when use the int() expression.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
Helper V
Helper V

Re: Create sharepoint item with date

Hi Alice,

Here is my excel table. Something this field is empty.

 

sbgoh_0-1596449299467.png

In the "Create item", open date, I set the following expression:

addDays('1899-12-30',int(items('Apply_to_each')?['openDate']),'yyyy-MM-dd')

sbgoh_1-1596449441286.png

Run History below.

sbgoh_3-1596449726409.png

 

 

Highlighted
Community Support
Community Support

Re: Create sharepoint item with date

Hi @sbgoh ,

 

You need to make sure the column wouldn't with empty value.

And if the column would have empty value, you should check if the column is null for each row, if the column is null, you could set the default date in the new item or don't create new item for this row.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,104)