Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Textbox should be filled with current date

(1) ShareShare
ReportReport
Posted on by 125

Hi 

In my app, i have a blank textbox and a button.

I need functionality that when user click on button. Textbox should autofilled with current date & time .

 

Currently the date is reflecting in display form after submit but when we are editing that record in edit page that text box is showing blank. I need that should contain the submit time..

 

 

Help anyone aware of it.

Categories:
  • CU24070609-0 Profile Picture
    CU24070609-0 on at
    Textbox should be filled with current date
     
    Is it resolved? Can you pls share with me?
  • CU24070609-0 Profile Picture
    CU24070609-0 on at
    Textbox should be filled with current date
     
    I have tried the steps but it's not working.
    Can you please help?
     
    Thanks.
     
  • Ali_sam Profile Picture
    Ali_sam 125 on at
    Re: Textbox should be filled with current date

    Actually it is a form. When user submit the form after that when approver open it & approved or denied then this is needed. Then the approved/denied time should be submit.

  • MaximusDecimus Profile Picture
    MaximusDecimus 276 on at
    Re: Textbox should be filled with current date

    Okay - so you may have a column in your SharePoint list called Created which logs when then entry was added in. I'm assuming that this is the case, if not then you'd just need to create a time logged column and set it so it defaults to current date/time

  • Ali_sam Profile Picture
    Ali_sam 125 on at
    Re: Textbox should be filled with current date

    Yes its a form. And i am using SharePoint as datasource

  • MaximusDecimus Profile Picture
    MaximusDecimus 276 on at
    Re: Textbox should be filled with current date

    Are you using a form to submit? 

    Also what is your data source? (SharePoint List, SQL etc...)

  • Ali_sam Profile Picture
    Ali_sam 125 on at
    Re: Textbox should be filled with current date

    It should be saved and then auto reset for next record

  • Ali_sam Profile Picture
    Ali_sam 125 on at
    Re: Textbox should be filled with current date

    Working but bot fully. Because its showing the same time for all record by default..

     

    Like i submitted a request before an hour ago, and one is submitted now. Before one is showing current time

  • DavidZoon Profile Picture
    DavidZoon 736 on at
    Re: Textbox should be filled with current date

    Hello,

     

    You have to use a variable and the Text() function :

     

    In your Button.OnSelect : UpdateContext({vCurrentTime:Text(Now(),"dd/mm/yyyy")})

    Replace "dd/mm/yyyy" by desired format

     

    In your TextInput.Default : vCurrentTime

     

    You can add a button or an icon to clear the textinput with : UpdateContext({vCurrentTime:""})

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily.

  • MaximusDecimus Profile Picture
    MaximusDecimus 276 on at
    Re: Textbox should be filled with current date

    Hi @Ali_sam 

     

    Set the button OnSelect property to this:

     

    UpdateContext({varTimestamp: Now()})

     

    And the Default property of your text box to varTimeStamp

     

    Every time the user clicks the button the variable will be updated to the current timestamp.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard