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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Populate Date Column i...
Power Automate
Unanswered

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.

Categories:
I have the same question (0)
  • Verified answer
    David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    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

     

  • amulhearn0207 Profile Picture
    109 on at

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

  • Verified answer
    wskinnermctc Profile Picture
    6,519 Moderator on at

    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

    @wskinnermctc This is BEAUTIFUL! Thank you!

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    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

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    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 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard