Announcements
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?
Hi @ezFlow
You need to use the substring function. Here it is
Above expressions are as follows:
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))
You sure substring(variables('DOBVAR'),1,4) is working? The index starts with zero.
See my results below.
Thanks
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
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.
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
David_MA 250 Super User 2026 Season 1
Expiscornovus 222 Most Valuable Professional
Haque 174