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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How do I format my "Ge...
Power Automate
Unanswered

How do I format my "Get Items" values to string?

(0) ShareShare
ReportReport
Posted on by

Hi, my first time posting here. It might be a relatively simple question but extensive googling couldn't give me an anwser (or I just didn't understand it).

 

So I'm trying to automatically create a bunch of events in my outlook calendar from a list. (exam dates and times for students). I think I got the flow down pretty well except I'm running into one problem. That is the below screenshot.

ThomasBoeve_0-1691750226440.png

InvalidTemplate. Unable to process template language expressions in action 'Create_event_(V4)' inputs at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

 

So my question is, how do i make sure Get Items gives me string variables as outputs, or why does it give 0 results at all. I've used a similar structure with a scheduled flow where it worked without problems. Below are screenshots of the flow in editing mode. and expressions used

ThomasBoeve_1-1691750458886.png

formatDateTime(items('Apply_to_each')?['Datum'],'yyyy-MM-ddTHH:mm:ss')

formatDateTime(items('Apply_to_each')?['Einde_tentamen'],'yyyy-MM-ddTHH:mm:ss')


Thank you very much in advance for taking the time to help me out.

Categories:
I have the same question (0)
  • SamLed Profile Picture
    2,338 Moderator on at

    Hi,

    I guess your "End Date" is not mandatory in SharePoint list, so if it is not populated, you'll get null. you can't obviously expect Get Items giving another value than null in such case. 

     

    But you can check if empty before using formatDateTime() which expects a value.

     

    if(empty(items('Apply_to_each')?['Einde_tentamen']), '', formatDateTime(items('Apply_to_each')?['Einde_tentamen'],'yyyy-MM-ddTHH:mm:ss'))

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard