Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Trouble converting string to date using convertToUtc

I have a text column in my custom CDS entity containing a string of a date. Most fields are empty.

I want to build a Flow which will will convert the string to a value of type datetime and update the date field in the same record, for all records in my custom entity.

Its failing with a 400, BadRequest, error. What am I doing wrong?

Attached images show the flow and the resulting error.

Source column values are either empty or in the format "7/7/1977".FlowFailDateConvert.PNGFlowFailDateConvert2.PNG


Community Support
Community Support

Hi @BrianSlalomMS,


You couldn't enter the expression in the "PCN Status Date" in the "Update a record" action directly.


Please add a dynamic content with the expression in your "PCN Status Date" in the "Update a record" action.


I have made a test on my side, you could refer to screenshot below to add the dynamic content with the expression:



The flow would run successfully as below:



Best regards,



I made the change you suggested but my Flow still fails.


Here is the full text of my expression.

convertToUtc(item()?['cr89e_pcnstatusimportastext'], 'Pacific Standard Time')

Here is the earlier portion of my Flow. I am trying to apply this update to each record in a list. Referencing each record individually is probably my issue.


Tried this as well. 



Getting closer, the correct date is filled in, but it fails with no specific error message.


Another important thing to note is that my destination date field is of type Date&Time, not string/text.

Is there some other function I should be using to convert a date string to a Date&Time field type?

Helpful resources

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,151)