Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Populate Date Column in SharePoint using String

(0) ShareShare
ReportReport
Posted on by 109

Hello.

 

I have a text field in a SharePoint list formatted as: AAA:20230114, where the text to the right of the colon (:) represents a date - in this example, January 14, 2023.

How can I manipulate that text and make it populate a date column in a SharePoint list?

Thank you.

  • David_MA Profile Picture
    11,517 Super User 2025 Season 1 on at
    Re: Populate Date Column in SharePoint using String

    Nice! I always have a hard time combining the expressions when it gets to be long. I always mess up the placement of a comma or miss or add too many parentheses 🙂

  • Kaif_Siddique Profile Picture
    2,104 Super User 2024 Season 1 on at
    Re: Populate Date Column in SharePoint using String

    Here is a sample flow. Customize as per your flow.

    Kaif_Siddique_0-1679435915964.png

     

    formatDateTime(concat(substring(last(split(outputs('Compose'),':')),4,2),'/',substring(last(split(outputs('Compose'),':')),6,2),'/',substring(last(split(outputs('Compose'),':')),0,4)),'MM/dd/yyyy')

     

    Output:

    Kaif_Siddique_1-1679436066297.png

  • amulhearn0207 Profile Picture
    109 on at
    Re: Populate Date Column in SharePoint using String

    @wskinnermctc This is BEAUTIFUL! Thank you!

  • Verified answer
    wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: Populate Date Column in SharePoint using String

    Dang, I'm late because I was making screenshots. However, I do have a way to get them in a single expression.

     

    Example FlowExample FlowExample Flow Results1Example Flow Results1Example Flow Results 2Example Flow Results 2

     

    The above flow is examples that were in general.

     

    Below is for a single expression.

    TextDate to DateFormat Single Expression Flow.pngTextDate to DateFormat Single Expression Flow Results.png

     

    Below is the full expression:

     

    formatDateTime(concat(substring(last(split(variables('FullTextWithDate'), ':')), 0, 4), '-', substring(last(split(variables('FullTextWithDate'), ':')), 4, 2), '-', substring(last(split(variables('FullTextWithDate'), ':')), 6, 2)), 'yyyy-MM-dd')
  • amulhearn0207 Profile Picture
    109 on at
    Re: Populate Date Column in SharePoint using String

    Thank you, this is excellent, as my items are always formatted identically to the sample. 

  • Verified answer
    David_MA Profile Picture
    11,517 Super User 2025 Season 1 on at
    Re: Populate Date Column in SharePoint using String

    Your content is always consistently formatted the way you show it? If so, you can use some expressions to generate it in the format needed to populate the SharePoint date field:

    David_MA_0-1679428928537.png

    I created a manually triggered flow to test it on your format. The first expression takes your value and splits it on the semicolon and gets the last part (the number date):

    last(split(triggerBody()['text'],':'))

     The next expression concatenates the number to format as an ISO8601 date (yyyy-MM-dd):

    concat(substring(outputs('Compose'),0,4),'-',substring(outputs('Compose'),4,2),'-',substring(outputs('Compose'),6,2))

    The last compose is just to illustrate that it recognizes Compose 2 output as a valid ISO8601 date:

    formatDateTime(outputs('Compose_2'),'D')

     Which results in this from your example:

    David_MA_1-1679429209930.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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492