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 / Disable a form (with I...
Power Apps
Unanswered

Disable a form (with ID) and button if workflow for this ID starts

(0) ShareShare
ReportReport
Posted on by 10

Hello.

I have a form with a workflow triggered by the IDs form, and this flow must send pdf to sign with adobe sign ( with the button 'send to signature').

But what I need is to really block my buttons outside the form ( 'save form' and 'preview form') AND the form also to avoid someone to save again or modify my form while the flow is running and after also, when its finished. 

I tried a few options i found here, it works but it blocks all my forms in my sharepoint, and this is not my objectif. I need to disable my edit form juste for this one i sent to signature.

I'm really stuck at this point and i hope someone can help me with any suggestions, please.

 

 

 

 

 

 

If(
 AllowToChangeForm;
 UpdateContext({Success: GenererDESigné.Run(IDselected).success});;
 btn_download_6.DisplayMode.View;;
 If(
 _varUnsavedData;
 Notify(
 "Please save the form";
 NotificationType.Error
 );
 If(
 Success = "Oui";
 Notify(
 "The form is sent for signature";
 NotificationType.Success
 )
 );;
 Set(
 documentGenerate;
 GenererDESigné.Run(IDselected).signingurl
 );;
 Refresh('Description Emploi')
 )
);;
btn_download_6.DisplayMode.Edit;;
UpdateContext({_varUnsavedData: false})

 

 

 

 

 

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @nslbsa19 

    Based on what you are saying here, it seems like you might want a solution that could:
     
    - Disable the 'Save Form' and 'Preview Form' buttons while the flow is in the process of running.
    - Prevent further edits to a form once it's been sent for signature.
     
    One way to approach this, could be to add an additional status field to your SharePoint list that tracks the form status. 
     
    You could have states like 'Editing', 'Awaiting Signature', 'Signed', etc.
    Then, you can modify your Power Apps form and Power Automate flow to update this status accordingly.
     
    The steps can be as follows:
     
    1. Add Status Field to SharePoint List: Add a choice field to your SharePoint list. Name it 'Form Status' or similar and provide some choice values like 'Editing', 'Awaiting Signature', 'Signed', etc.
     
    2. Update Status in Power Apps Form: In your Power Apps form, update the 'Form Status' field value to 'Awaiting Signature' when the form is sent for signature, and then to 'Signed' when it's returned.
     
    3. Disable Buttons Based on Status: Set the DisplayMode property of your 'Save Form' and 'Preview Form' buttons to depend on the 'Form Status' field value. 
     
    4. Prevent Editing Based on Status: Similarly, you can prevent editing the form based on the 'Form Status'.
    So, you can do this by setting the DisplayMode of the form to DisplayMode.View if the 'Form Status' is 'Awaiting Signature' or 'Signed':
     
    If(ThisItem.'Form Status'.Value="Awaiting Signature" || ThisItem.'Form Status'.Value="Signed", DisplayMode.View, DisplayMode.Edit)
     
     
    5. Update Status in Power Automate: When you send the form to be signed in your Power Automate flow, update the 'Form Status' field value to 'Awaiting Signature'.
    When the form is signed and returned, update it to 'Signed'.
     
    Make sure your Power Automate flow has the permissions to update items in your SharePoint list.
     
    See if this helps @nslbsa19 
  • nslbsa19 Profile Picture
    10 on at

    Hello there. Thank you so much for your return. I’m barely new to power apps and automate. I understand very well your suggestion and I hope to be able to put in practice. I think this is exactly what I need. 
    I’ll come back with updates. 

  • nslbsa19 Profile Picture
    10 on at

    Hello there.

    I'm trying to apply your suggestion, but its not working for the point 2  and 3. I'm trying to think the best way to update the form status value to 'Awaiting Signature' when the form is sent for signature, and then to 'Signed' when it's returned, and also to set the DisplayMode  depending on the form status value.

    I created a global variable at onstart with the values for the status,

     

     

    Set(
     statusForm;
     {
     Editer: "Editer";
     AttendSignature: "En attente de la signature";
     Signe: "Signé"
     }
    );;

     

     

     

    once i dont want to define a status in my form, so i put my datacard dropdown (with the variable values) form status at not visible.

     

     

    Items for dropdown form status
    If(
     documentGenerate;
     ThisItem.'Statut du Form' = "En attente de la signature";
     ThisItem.'Statut du Form' = "Editer"
    )

     

    My DisplayMode button save the form and preview form to:

    If( statusForm = "Signe" || statusForm = "AttendSignature";
    DisplayMode.View;
    DisplayMode.Edit
    )

    And the my Send for signature button like this:

     

    If(
     AllowToChangeForm;
     UpdateContext({Success: GenererDESigné.Run(IDselected).success});;
     btn_download_6.DisplayMode.View;;
     If(
     _varUnsavedData;
     Notify(
     "Please save the form";
     NotificationType.Error
     );
     If(
     Success = "Oui";
     Notify(
     "The form is sent for signature";
     NotificationType.Success
     )
     );;
     Set(
     documentGenerate;
     GenererDESigné.Run(IDselected).signingurl
     );;
     UpdateContext({ statusForm : statusForm.Signe});;
     Refresh('Description Emploi')
     )
    );;
    btn_download_6.DisplayMode.Edit;;
    UpdateContext({_varUnsavedData: false});;
    UpdateContext({ statusForm : statusForm.Editer})

     

    Can you please give me more hint about the code to write, please.

    Thank you so much.

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard