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 / Update a single line t...
Power Apps
Answered

Update a single line text field in SharePoint based on a button select event

(0) ShareShare
ReportReport
Posted on by 116

Hi,

 

I have a form with "Submit" button. I would like to set the  value of a text field with name  "Start workflow" to "Yes" when user clicks on the "submit" Button and also save any unsaved changes.

 

Once it is submitted, the "Submit" button should be disabled.

 

I tried using Patch , set Var nothing really worked. Can someone help with correct syntax and functions to use?

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @cooltechie 

     

    On button select

     

    Patch(DataSource, Lookup(DataSource ID = itemid,{ColumnInternalName:"Yes"})

     

    ID = itemid - This should be the query that identifies the data row to update

    ColumnInternalName - internal name of column to update

    "Yes" - text column value 

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

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

    Hi @cooltechie ,

    Do you want the button becomes disabled after you submit the form?

    If so, try this :

    1)Set the button's OnSelect:

    Patch(tablename,LookUp(tablename,....),{fieldname:"test"});Set(var,1)

    1)Set the button's DisplayMode:

    If(IsBlank(var),DisplayMode.Edit,Disabled)

    Then after you clicking the submit button, your variable var will not be blank value, the button's DisplayMode will change to Disabled.

     

     

    Best regards,

  • cooltechie Profile Picture
    116 on at

    Hi Reza,

     

    I am trying your code, however, I do not see option to select the dynamic variable itemid

     

    Patch('My Requests', LookUp('My Requests', ID=???  ),{'Start WF?':"Yes"});

     

    When you say ID = itemid are you expecting me to hard code a particular ID? or should itemid be defined elsewhere?

  • Verified answer
    cooltechie Profile Picture
    116 on at

    What worked for me is the following code for On Select of the button:

     

    Patch('My Requests', {ID: Value(ID_DataCard1.Default)},{'Start WF?':"Yes"}); SubmitForm(SharePointForm1);

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard