Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Convert date time format in a create csv table.

(0) ShareShare
ReportReport
Posted on by 49
Hi All,

I have a flow set up which reorders a CSV table so that our other system can accept it (has to be formatted in a certain way). See screenshot below.


Here is what the error I am getting in our system looks like, this part isn't important but I would need to format the date/time in a different way ideally without the T and the + as our system doesn't understand it.

Would it be possible to use formatDateTime() to reformat this date and time to a simpler format? I am really look for a few ways to do it as I'm not sure which date format will work I need to try a few to see what it would like, but would this be possible to do if so how would it look in this create a csv table?

Thanks,
Ben
 
  • Watkins Profile Picture
    Watkins 49 on at
    Convert date time format in a create csv table.
    Hi KT-11121621-0,

    Yes that is correct. I am not sure what the correct time format would need to be, but if I know how the formatDateTime() expression would look like with the Split function I have used in the create CSV table then I could try a few different formats to see which one does work.

    David_MA,

    If it does help the other system I am using is called SkyBill and is based on a microsoft business central platform. I would just need to know how the formatDateTime() expression would look whilst using the split expression.

    I assume it would look something like this, 
    formatDateTime(split(item(),';')?[2], 'M/dd/yyyy h:mm tt') but this didn't work for me.

    I am just not sure how this would look with a split expression.

    Thanks.


     
  • KT-11121621-0 Profile Picture
    KT-11121621-0 14 on at
    Convert date time format in a create csv table.
    I think the missing piece here is we don't know what the date format is that your target system requires.
     
    Is it: 2024-12-08 20:59:57 00:00? You mentioned that you need the Z and + removed.
     
    Please let us know.
     
  • David_MA Profile Picture
    David_MA 8,364 on at
    Convert date time format in a create csv table.
    @Watkins I am not sure I follow what you posted in your second post, but you can definitely use the formatDateTime() expression to format a date in pretty much any format you need. You can refer to this reference: formatDateTime in Power Automate in 2024. Note, with all of these, the formatDateTime() expression requires the date be in ISO 8601 format: ISO - ISO 8601 — Date and time format. I don't know what your "other platform" is so I cannot help with why you are getting the error message there. 
  • Watkins Profile Picture
    Watkins 49 on at
    Convert date time format in a create csv table.
    Hi David, 

    I probably wasn't as clear as I thought I was, that error is on our other platform, what I would need to do is use formatDateTime() in the split expression to format the date and time differently so that it does work on our other platform, the date and time comes in as 2024-12-08T20:59:57 +00:00 and I would need to format it a different way.

     
  • David_MA Profile Picture
    David_MA 8,364 on at
    Convert date time format in a create csv table.
    I am sure you can use formatDateTime() to solve your issue, but from what you've provided I cannot tell where in your process the error is being generated. I will assume it is occurring in the split expression of the Datetime value. However, I don't see anything in the you split expression that is trying to convert the value to a date. Where is that happening? Within in the error, it says you are passing the time zone offset to (+00:00). To format a date, the date needs to be in ISO 8601 format. It all looks correct, except ISO 8601 would be 2024-12-08T20:59:57Z instead of 2024-12-08T20:59:57 +00:00.

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard