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 Apps / Can't make DatePicker ...
Power Apps
Unanswered

Can't make DatePicker output as Date instead of String

(1) ShareShare
ReportReport
Posted on by 16

Hi

 

I'm building a Power App which outputs the date from DatePicker to Power Automate, where a meeting is added to a calendar, with as date the output from DatePicker.

But I can't get it to work. The trigger I use is PowerApps V2. When I use the "Date" option, the flow doesn't receive it because it's a string, not a date.

When I use type "Text" in the flow trigger, it works and the flow receives the date I selected in de PowerApp, but the "add to outlook calendar" function doesn't work because it's a string.

I've been trying to fix this for a week now, I watched lots of videos, many topics, tried so many things but nothing works...

One of the things I tried was converting the string to a date (tried different formulas) but none of them worked, because it's a string...

Even if I change the format in the DatePicker properties, it's always "dd-MM-yyyy", and a string.

 

I think the problem and fix are in the PowerApp, but I can't get it to work. So I hope someone can help me fix this.

 

If you need more information, let me know! 

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Just put a test together for you.

     

    Here is what i did

    my flow is from powerapps and has a trigger date variable / date

     

    compose is as follows

    formatDateTime(triggerBody()['date'])

     

    Start & End time in calendar creation are both just the output of the compose step. In my example theres no time, so sets it by default to 12am, but you can edit this into it as well

     

    Capture.PNG

     

    my button in powerapps functions as follows

    datetest.Run(Text("2022-10-26"))

     

    yyyy-mm-dd is correct format for flow to see it as a date on the pass through, and the compose step will convert it to a date

     

    and pressing button created the item in my calendar as seen below

    Capture2.PNG

  • JonaV Profile Picture
    16 on at

    Thank you for your help!

     

    So, I added the compose step and now my flow is the same as yours.

    In powerapps, I used the following code:

    'PowerApps-GeenHelpdesk'.Run(Reden; 'Office365-gebruikers'.MyProfileV2().displayName; Text("2022-10-26"))

    Note: the first two (Reden & Office365-gebruikers'.MyProfileV2().displayName) are used for other information (and are working).

    It goes into the flow like I entered (2022-10-26), but still as a string. The compose action can convert it to ISO, and Add To Calendar works too, thank you!

     

    But when I change Text("2022-10-26") to Text(dateDatum; "yyyy-mm-dd") I get an error because it's a string, before it even goes to the flow. (PowerApps-GeenHelpdesk.Run failed: {"error": {"code": "TriggerInputSchemaMismatch",
    "message": "The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'String '18-10-2022' does not validate against format 'date'.'."}}

     

    Do you know a solution for this?

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Your date is coming off a date picker right? have you tried this? Seems to work on my end

    Text(DatePicker2.SelectedDate,"yyyy-mm-dd")
  • JonaV Profile Picture
    16 on at

    It's working! Thank you so much for your help!

    Have a nice day!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard