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 / If label appears then ...
Power Apps
Answered

If label appears then don't save SharePoint form

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

Hi, I'm integrating the Sharepoint form with Power Apps. I'm trying to make if the label appears then, if the user clicks Save, they cannot save it. I tried the formula below but it still saves. How to fix this?

 

anonymous21_0-1657168129130.png

 

SharePointIntegration.OnSave

If(Label1.Visible=true, false ,SubmitForm(SharePointForm1));

 

Thank you

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @syhrh 

    Try in the button's Display mode property

    If(Label1.Visible,Disabled,Edit)

    Lable1.Visible reduces to either true or false.

     

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

    @Drrickryp It's a Sharepoint integration so there's no save button on the screen except the Save button in the Sharepoint form. So where to put the formula?

    anonymous21_0-1657172775487.png

     

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    @syhrh I re-created your example and mine did not save the changes, it notified me that it was unable to save - I used Notify instead of false:

     

    If(Label1.Visible, Notify("Cannot save!") ,SubmitForm(SharePointForm1));

     

    Make sure your browser has not cached the old form though, make a change like putting a new label (or version  number) in  somewhere so that you can see that you using the most recent version. I had to refresh multiple times and eventually just loaded the sharepoint list in a new tab to force it to re-fetch the new app version

     

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

    @iAm_ManCat I tried that formula but it still saves the form. 

    Make sure your browser has not cached the old form though, make a change like putting a new label (or version  number) in  somewhere so that you can see that you using the most recent version. I had to refresh multiple times and eventually just loaded the sharepoint list in a new tab to force it to re-fetch the new app version

     

    I don't understand what you mean here. Is it a way to ensure the formula works?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Ok, happy to explain, so when your browser loads up the form, it keeps a local copy to stop it from re-downloading it every time. Sometimes this can cause the most recent update to your form to not show until your browser has reloaded its cache of stored items.

     

    So for example, if you add a red label to your app, go back out and view the form on the SharePoint list and can't see the red label, then you know are still viewing the older saved copy of the form as your browser hasn't re-downloaded it.

     

    Your formula likely is working, but your particular browser on your particular computer hasn't downloaded/refreshed to the newest version of it yet

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

    @iAm_ManCat Thank you for your explanation. So it means that I just need to refresh many times for the formula to work right?

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

    @iAm_ManCat I re-tried the formula and it works; the notification, "Cannot save!" is displayed for a second then it disappears and still saves the form. How to fix that?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Are you sure there's no other code in your App that saves the form? by getting that notification we've proved that it's not the SharePointIntegration.OnSave that is saving the form.

     

    Use the Search icon on the left command rail (enable it in App settings if not enabled), and then try search for Submit

    this should show you where else the submit function is being called in your App

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

    @iAm_ManCat I still can click save but the item is not displayed in the list. However, after I re-open the form, the Cannot Save! notification appears.

    anonymous21_0-1657684706570.png

    is it because of the formula arrangement in the SharepointIntegration.OnSave?

     

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Where else have you put this formula? if it's only on the OnSave, then it shouldn't be showing when you open the form unless you've just recently closed that same item.

     

    You will still be able to click save, you can't disable the SharePoint integration from being clicked, my question was whether the item is Actually saving the changes - that warning message we are displaying is what shows when the item is Not saved, and so there should be no changes to the item.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard