cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sbgoh
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

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
Rahber
Super User II
Super User II

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

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

sbgoh_0-1596362816832.png

 

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.

 

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

 

 

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,262)