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 Apps / How to convert date-ti...
Power Apps
Unanswered

How to convert date-time formatted string from a custom API connector to a text property in a label?

(0) ShareShare
ReportReport
Posted on by 62

I have a collection (collectionLastUpdated) that contains a 'dtTime' property with a date-time formatted string value from an API.  When I created the API connection in Flow, Flow assigned the value as a date-tme formatted string (not simply a string).  I can't figure out how to display the date-time value in a text label.  It seems I need to convert the date-time to a string or something but could not find a function to do it.  Below is the code I currently have in the label text field (if a date-time value exists then show it, else show the text 'download collection data':

 

If(CountRows(collectionLastUpdated)=1,

First(collectionLastUpdated).dtTime,

"download collection data")

 

// sample data

"collectionLastUpdated": {"dtTime":"08/21/2018 13:24:45"}

Categories:
I have the same question (0)
  • v-zhta-msft Profile Picture
    Microsoft Employee on at

     

    Hi @ willick

     

    Could you please share more information about your issue?

     

    Which format does “dtTime ”belong to, date-time or string?

     

    I did a test on my side and it works fine.

     

    Here are the screen shots:

     

    1: Create a collection

     

    ClearCollect(collectionLastUpdated,{title:1,dtTime:"08/21/2018 13:24:21"})

     

     

    2: Display the dtTime string in a text label:

     

    If(CountRows(collectionLastUpdated)=1,First(collectionLastUpdated).dtTime," download collection data")

    q1w2.png

     

     

    If the “dtTime” column is a Date time type column, if you want to convert the dtTime column value into a string, I think the Text function could achieve your needs.

     

    Here are some links maybe you can use:

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datevalue-timevalue

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-text

     

    Hope this helps you.

     

    Best regards,

    Zheng

  • willick Profile Picture
    62 on at

    Hi @v-zhta-msft, I should have clarified that this date-time value is coming from an API so the value that you are using is most likely string formatted and not date-time formatted as I am receiving.  So my question probably applies more to MS Flow.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard