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 / How to validate if use...
Power Apps
Answered

How to validate if user have click compute button to recompute leave duration before computing form.

(0) ShareShare
ReportReport
Posted on by 43

I have a button to allow users to compute leave duration after they selected start and end date of leave. If they did not click the button, leave duration will not be computed or recomputed after they selected or change start and end date of leave. 

How do I check if the users have click compute button before allowing them to submit form. 

 

Please help!! Any tips, guidance much appreciated. 

 

Jo

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @Jo_25 ,

    There are a couple of possibilities, but I would go with a Variable.

    At Screen OnVisible

    UpdateContext({varCalc:false})

    On the OnSelect of the Compute Button

    UpdateContext({varCalc:true})

    On the DisplayMode of the Submit form button

    If(
     varCalc,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Jo_25 Profile Picture
    43 on at

    Many thanks Warren. The solution is working very well. 

    Now, the users will not be able to submit the form when they did not click the compute button. All thanks to your help!! 😀

     

    I have another issue with the compute button  - not related to the solution you offered. 

    The compute button is able to compute the no of leave requested and stored it in a global variable - _requestedDays. However, the Duration field (which is a number field in Sharepoint) is not being updated with the _requestedDays when I do a SubmitForm to create the new record in Sharepoint. 

    I read from some forum post that I need to set the Default property of the Duration card to 

    If(!IsBlank(_requestedDays), _requestedDays, ThisItem.Duration) but somehow Duration field in Sharepoint is not updating.  See screen capture below. How can the Duration field be updated? Please help. 

     

    sc5.PNGsc4.PNG

  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @Jo_25 ,

    I have answered you over on the new post you did.

    I suspect I am in a different time zone to you  (I am at UTC + 10 - Eastern Australia)

  • Jo_25 Profile Picture
    43 on at

    Hi, Warren

     

    Thanks. I posted in the new post cos I am seriously desperate to get solution to the issue. I have been searching forum posts and tried what suggested but with no success.  

     

    Jo

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard