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 / Power App button refresh
Power Apps
Unanswered

Power App button refresh

(0) ShareShare
ReportReport
Posted on by 16

I have a Button in the Powerapps. The user refreshes the report using that button. I want the functionality of the availability of the button. 

 

Thanks In advance

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Bash-- 

     

    Unfortunately, We can't use the timer since timer data will be lost once the session ends or closed the application. The right design is to store it in Data Source.

     

    For Example, Once the user pressed the button

     

    UserEmail                        DateTimePressed 

    Bash@mail.com              02/17/2022 17:50 PM

    Stalin@mail.com             02/16/2022 10:00 AM

     

    When the form Loads Set the display mode of the button to

    With({item: LookUp(DataSource, UserEmail = User().Email, DateTimePressed)},
    If(IsBlank(item) || DateDiff(Now(),item, Days) > 30, DisplayMode.Edit, DisplayMode.Disabled)
    )

     


    Thanks, Stalin
    Blog - Learn To Illuminate Blog
    YouTube - Learn To Illuminate Videos 

  • Bash-- Profile Picture
    16 on at

    @StalinPonnusamy What's the best approach to load data back to the data source?

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Bash-- 

     

    Set OnSelect property of the button to

    Patch(DataSource, Defaults(DataSource), 
    {
    UserEmail : User().Email,
    DateTimePressed: Now()
    }
    )

     


    Thanks, Stalin
    Blog - Learn To Illuminate Blog
    YouTube - Learn To Illuminate Videos

  • Bash-- Profile Picture
    16 on at

    @StalinPonnusamy Thanks for the quick response. Last query related to this. Is powerApps will always pick the latest date. As we patch will add the date in the data source not update. 

    Thanks you so much

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    HI @Bash-- 

     

    Good catch. The above patch always creates a new one. In our case, the user can press/click it again. So we need to change the patch function.

     

    Set OnsSelect property of the button to

    With({item: LookUp(DataSource, UserEmail = User().Email, DateTimePressed)},
    Patch(DataSource, If(IsBlank(item), Defaults(DataSource), item),
    {
    UserEmail : User().Email,
    DateTimePressed: Now()
    }
    )
    )

     

    Note: The above code creates a new record for the first time and then updates the existing one after that.

     

    Sorry for the late response because of the time zone. I just started my day.


    Thanks, Stalin
    Blog - Learn To Illuminate Blog
    YouTube - Learn To Illuminate Videos

     

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