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 Apps / Date issue in iPhone
Power Apps
Answered

Date issue in iPhone

(0) ShareShare
ReportReport
Posted on by 45

I am having an issue where my code works correctly in Android phones and incorrectly in iPhone.

Here is my code:

*****************************************

Set(DateVar,DateValue(Left(AvlDatesListBox.Selected.DateNDay,Find("-",AvlDatesListBox.Selected.DateNDay))));

--A sample value for the DateNDay value is:  09/30/2019-Mon

*******************************************

This code works fine in Android phones and returns 9/30/2019 for DateVar value. But it does not work in iPhone and returns a blank value for DateVar

Any thoughts on what could be going wrong?

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @prasadvenkat 

    While I don't have access to both Android and iPhone, I wonder if you could use the Text() function to format the datetime so it appears correctly on both mobile phones.  Try this:

     

    Set(DateVar,Text(DateValue(Left(AvlDatesListBox.Selected.DateNDay,Find("-",AvlDatesListBox.Selected.DateNDay))),"m/d/yyyy");

     

    The Text() function takes two arguments: the 1st is a date/number variable and the 2nd is formatting instructions in a text string format.  I think the result of the formula will now be 9/30/2019 on both phones.  Let me know

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @prasadvenkat ,

    Based on the formula you provided, I found that there is something wrong with it. The Left(AvlDatesListBox.Selected.DateNDay,Find("-",AvlDatesListBox.Selected.DateNDay)) formula would return "09/30/2019-" (including '-' at the end) rather than "09/30/2019".

     

    Please consider modify your formula as below:

    Set(
    DateVar,
    DateValue(
    Left(AvlDatesListBox.Selected.DateNDay, Find("-", AvlDatesListBox.Selected.DateNDay) - 1) /* <-- Modify formula here */
    )
    )

    In additon, you could also consider take a try with the following formula:

    Set(
     DateVar,
     DateValue(
     First(Split(AvlDatesListBox.Selected.DateNDay, "-")).Result /* <-- Modify formula here */
     )
    )

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Prasad Venkat Profile Picture
    45 on at

    great..thx.  worked perfect for me. I like the split function.. din't realize powerapps has a split like in traditional scripting languages

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard