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 Automate / How to convert an arra...
Power Automate
Unanswered

How to convert an array of string into date

(0) ShareShare
ReportReport
Posted on by 565
Hi everyone,
 
I am reading a dataverse table, when a new record is created, run this flow.
Based on the column "DatesRequested", I create an array with these string values:
 
 
 
Then, I need to get each value of this array, convert to Date format and use the result to "Add a new row" in other table.
 
The array is:
 
array(triggerOutputs()?['body/cr815_datesrequested'])
 
How can I get each value and convert to date?
 
In a Compose I have:
 
formatDateTime(convertFromUtc(item()?['cr815_datesrequested'], 'yyyy-MM-ddTHH:mm:ssZ'), 'MM-dd-YYYY')
 
But it is not working.
 
I get this error:
 
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'formatDateTime(convertFromUtc(item()?['cr815_datesrequested'], 'yyyy-MM-ddTHH:mm:ssZ'), 'MM-dd-YYYY')' cannot be evaluated because property 'cr815_datesrequested' cannot be selected. Property selection is not supported on values of type 'String'. 
 
Thanks for any help!
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,874 Most Valuable Professional on at
     
    You can use split and parsedatetime functions for this. Your text value can be split via the comma character. With an indexOf you can check if the split is available (in your second row it isn't). If it is a single date it will convert it to an array, otherwise it will split.
     
    Below is an example
     
    1. In the apply to each use the below
    if(equals(indexOf(triggerOutputs()?['body/cr815_datesrequested'], ','), -1), array(triggerOutputs()?['body/cr815_datesrequested']), split(triggerOutputs()?['body/cr815_datesrequested'], ','))
    2. Use the below expression to parse the date time
     
    parseDateTime(item(), 'en-us', 'MM/dd/yyyy')
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard