Skip to main content

Notifications

Power Automate - General Discussion
Answered

Creating Planner Tasks from Excel - error date format

(0) ShareShare
ReportReport
Posted on by

Hi,

i created a flow that creates a planner tasks from a list of rows in excel.

when using UTCNOW and ADDDAYS as parameters it woked fine, but when im trying to get the date as input form the excekl im getting an eror.

below some screenshots to assist:

1. the excel date:

image.png

2. flow - create a task

image.png

3. error message

"The request is invalid:\r\nCannot convert the literal '43662' to the expected type 'Edm.DateTimeOffset'.",
"innerError": {
"request-id": "1fa2c77f-93f7-493d-b9c6-c6f833f52add",
"date": "2019-06-26T15:27:17"
 
thanks a lot
Perez
  • srahulkumar841 Profile Picture
    srahulkumar841 3 on at
    Re: Creating Planner Tasks from Excel - error date format

    Please use Convert TimeZone and select RoundTrip pattern, this should solve of converting to format required by "Create Task"

     

    srahulkumar841_1-1669654991240.png

     

     

  • auteur17 Profile Picture
    auteur17 2 on at
    Re: Creating Planner Tasks from Excel - error date format

    @Perez 

    Hello!

    On the above thread, I am successful at doing the date conversion, but like @Miel I am not able to find where the output is after the date has been converted.

     

    Can you assist in assigning the date value to another field later in the flow?

     

    Thank you in advance!

    -- Matt

  • Re: Creating Planner Tasks from Excel - error date format

    @Miel  the solution as proposed by msftis working fine, you should use the formulas as described in his response, than just use the second compose output as your new date value

  • MilesBBB Profile Picture
    MilesBBB 31 on at
    Re: Creating Planner Tasks from Excel - error date format

    Hi I've got this same issue. I was able to add in your expressions with the Compose 1 and Compose 2 to get the right date.  However I'm stuck as to what to do after that?  How do you get the correct date in the "Create a Task" operation?  I inserted your Compose operations just above my already existing "Create a Task" operations and still got the same error.  Thanks,

  • marco_popolizio Profile Picture
    marco_popolizio 12 on at
    Re: Creating Planner Tasks from Excel - error date format

    Hello,

    I have exactly the same problem described above and until now I've understood I have to use the expression

    addDays('1900-01-01',int(items('_')?['Date'])) ...

    However I have only very basic knowledge of Flow and can't figure out how to make the expression work...

    Can anyone tell me exactly what to do? 😞

     

    Cattura.PNG

  • Verified answer
    Re: Creating Planner Tasks from Excel - error date format

     i found another workaround that work for me, i put as a start date UTCNOW and in my excel im giving numeric intervals per task from day 1.

     

    thanks a lot for your repsonses

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    Re: Creating Planner Tasks from Excel - error date format

    Hi @Perez ,

     

    It is a known issue that Date and time returned from the Excel Online table will be converted to a string but not a date.

     

    You need to use a function to format it to a valid date and time.

     

    Please check the following flow for a reference.

     

    Compose is used to get the actual return value of the Start date.

     

    In Compose2, input the following code to get the exact date:

    addDays('1899-12-30',int(outputs('Compose')),'yyyy-MM-dd')

    1.PNG2.PNG

     

    Best regards,

    Mabel

     

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Creating Planner Tasks from Excel - error date format

    Hi @Perez 

     

    The expression is correct but the date format that you are getting from Excel is not. Were you able to change the column data type to text in excel?

  • Re: Creating Planner Tasks from Excel - error date format

    Hi @yashag2255 ,

    thanks for your fast reply.

    i tried to implement, it didnt worked, i think i didnt got the formatDateTimefunction correctly.

    i tried: formatDateTime(item()['Due Date'],'dd/MM/yyyy')

    is this correct? if not can you help with putting the correct expression

     

    the error i got:

    InvalidTemplate. Unable to process template language expressions in action 'Create_a_task' inputs at line '1' and column '1980': 'In function 'formatDateTime', the value provided for date time string '43662' was not valid. The datetime string must match ISO 8601 format.'.

     

    thanks,

    Perez

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Creating Planner Tasks from Excel - error date format

    Hi @Perez 

     

    This is an issue with the excel connector and the date type data format on the excel column. I would suggest you to first convert the datatype of your excel column to type text and then run this flow (use the fomrat date time function to format the string to date and time)

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard