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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Covert String into date
Power Automate
Unanswered

Covert String into date

(0) ShareShare
ReportReport
Posted on by 100

I'm pulling a string: 19761120, which I need to add to a SharePoint date field.

How do I convert or split the string to a format like 1976/11/20  that a Date field can accept?

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,852 Most Valuable Professional on at
    Re: Covert String into date

    Hi @ezFlow 

     

    You need to use the substring function. Here it is

     

     

    image.png

     

    Above expressions are as follows:

     

    substring(string(outputs('Compose')),0,4)
    substring(string(outputs('Compose')),4,2)
    substring(string(outputs('Compose')),6,2)
     
    Here is my test result
     
    image.png
  • ezFlow Profile Picture
    100 on at
    Re: Covert String into date

    Saved the string as a DOBVAR, and made it work.

    concat(substring(variables('DOBVAR'),1,4), '/', substring(variables('DOBVAR'), 5, 2), '/', substring(variables('DOBVAR'), 7, 2))

  • abm abm Profile Picture
    32,852 Most Valuable Professional on at
    Re: Covert String into date

    Hi @ezFlow 

     

    You sure substring(variables('DOBVAR'),1,4) is working? The index starts with zero.

     

    See my results below.

     

    Thanks

  • ezFlow Profile Picture
    100 on at
    Re: Covert String into date

    On all the Date field the substring starts with 0.
    This field (all comes from an excel that is generated by 3rd party software), worked with 1. 
    Perhaps there is a space

  • abm abm Profile Picture
    32,852 Most Valuable Professional on at
    Re: Covert String into date

    Hi @ezFlow 

     

    Yes thats the only reason that worked. I would say use the trim() to make sure the space is removed and start the index at 0. Thats the way I would do it. 

     

    If you happy with my earlier response please mark it as solution accepted.

     

    Thanks

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard