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 / Do not save in forms s...
Power Apps
Answered

Do not save in forms sharepoint if condition met

(0) ShareShare
ReportReport
Posted on by 997 Super User 2024 Season 1

Hi, I'm customizing the form in Sharepoint using Power Apps and I'm trying to notify users that if their leave balance is insufficient, they cannot save/create the item with a message that will be displayed like the formula below.

The Leave Balance list has all Number columns. 

 

Whenever the user chooses any of the leave types, it will check if the leave type balance in the leave balance list and whether the days applied are enough to apply. 

anonymous21_0-1656984068026.pnganonymous21_1-1656984223024.png

 

This is on SharepointIntegration.OnSave. I try this way but has errors. How to fix it?

 

If(DataCardValue1.Selected.Value = "Annual Leave" < DataCardValue15 And DataCardValue1.Selected.Value="Calamity Leave" < DataCardValue15,false);
SubmitForm(SharePointForm1);
ResetForm(SharePointForm1);
RequestHide();

 

Thank you.

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @syhrh ,

     

    Please set SharepointIntegration.OnSave .

     

    Best Regards,

    Bof

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    @v-bofeng-msft Yes, I set it in SharePointIntegration.OnSave but have errors. It was a typo when I posted it. Thank you

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @syhrh ,

     

    I think you maybe need something like this:

    If(
    LookUp('leave balance list',DataCardValue1.Selected.Value='leave balance type').RemainData < Value(DataCardValue15.text),
    SubmitForm(SharePointForm1);
    ResetForm(SharePointForm1);
    RequestHide();
    )

     

    Best Regards,

    Bof

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    @v-bofeng-msft 

    It has an error on the value

    anonymous21_0-1657078719881.png

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @syhrh ,

     

    Could you please tell me what DataCardValue15 is ?

     

    Best Regards,

    Bof

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    @v-bofeng-msft 

    anonymous21_0-1657086715970.png

    In the list, it is a number column

     

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

    Hi @syhrh ,

     

    Please try DataCardValue15.Text

     

    Best Regards,

    Bof

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    @v-bofeng-msft 

    anonymous21_0-1657087400182.png

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @syhrh ,

     

    Please capital 'T'.

     

    Best Regards,

    Bof

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    @v-bofeng-msft 

     

    There's still an error

    anonymous21_0-1657087745243.png

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard