web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to convert string ...
Power Automate
Unanswered

How to convert string into time format and pass the right type to json file

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear experts

 

the following flow scans a CSV file and imports into D365.

 

I got stuck to the column Delivery Time 

I need to convert delivery time from string to time in order to be able to feed the D365 data entity .

 

DELIVERYDATE,DELIVERYTIME,ITEMNUMBER,PRODUCTIONPOOLID,PRODUCTIONSITEID,SCHEDULEDQUANTITY
2020-12-01 00:00:00,10:00:00,2000029,IMP,B01,4000.000000
2020-12-01 00:00:00,12:00:00,2000029,IMP,B01,5000.000000
2021-12-01 00:00:00,14:04:00,2000029,IMP,B01,6000.000000

 

AlessandroP_0-1612944633788.png

 

So when defining the delivery time variable , I thought I would need to convert the string into time using the following expression

formatdatetime(split(item(),',')?[1],'hh:mm')

 

AlessandroP_1-1612945121603.png

 

but even if the above is correct , I get stuck in the Parse Json file as it does not accept type datetime.

 

Can you please help?

 

 

Categories:
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @Anonymous 

    I am not sure what is the purpose of the parseJson step here? You can directly do your apply to each on the select outputs and insert in Dynamics 365

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I removed the Json and now I cannot select any variable 

     

    AlessandroP_0-1612946198525.png

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hey @Anonymous 

     

    I've tested out your problem and your expression works for me:

     

    DamoBird365_0-1612987688500.png

     

    DamoBird365_1-1612987741866.png

     

    What error are you getting?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello

    thanks for looking into this 

     

    I get the following 

     

    AlessandroP_0-1612993066382.png

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    if you're sticking with the parsing - it's possibly "date-time" and not "datetime".

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I just tried and get the same error

    AlessandroP_0-1612993759855.png

    I am using the parsing but honestly if there is a better way can you show me how to do it ?

    My knoweldge in PowerAutomate is clearly very low and I am trying to test this flow.

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hey @Anonymous ,

     

    I think you are over complicating as I don't believe you need your Parse Json step as you can split the items straight from your apply to each.  See below for an example:

     

    DamoBird365_0-1613029452779.png

    Hope we've got you sorted.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hELLO

     

    Can we please stick to use parse JSON ? I don't have any expertise on how to do this in any other way .

    I put back the flow as originally was , 

    the column time is then a string containg hh:mm

     

    AlessandroP_0-1613114323606.png

     

    but once I tried to feed the data entity  and specify the variable time , it is not available as the data entity seems to accept only numeric values.

     

    Is there a way to convert the output of the variable time in numeric BEFORE feeding the data entity?

     

    AlessandroP_1-1613114415217.png

     

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard