Update String field with value of utcNow()

iamSara 1 Reputation point
2022-08-16T22:07:25.673+00:00

Hi,

I have a text field called LastRun in a SharePoint list which I need to update it with the value of utcNow() in the format of yyyy-MM-ddThh:mm:ss:00Z
231710-image.png

in my logic apps workflow I have a variable which is set to utcNow() and it returns date/time in the exact format that I want:
231737-image.png

but when I update the item the value changes to the yyyy/mm/dd hh:mm:ss format:
231782-image.png

I'm not sure what I'm missing here!

Any help would be appreciated.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,854 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kamlesh Kumar 3,861 Reputation points
    2022-08-17T04:57:21.957+00:00

    Hi @iamSara-3391 ,

    Welcome to Microsoft Q&A Platform. Thank you for the question.

    You can use the formatDateTime function to keep the expected format and it should work. I used the below expression to check the format.

    formatDateTime(variables('date'),'yyyy-MM-ddThh:mm:ss:00Z')  
    

    Hope this helped you,

    231799-image.png

    Regards,
    Kamlesh Kumar

    Please don't forget to click on 205836-130616-image.png or upvote 205759-130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is How

    Want a reminder to come back and check responses? Here is how to subscribe to a Notification

    If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators