cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cooltechie
Level: Powered On

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
cooltechie
Level: Powered On

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

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);

 

4 REPLIES 4
Super User
Super User

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

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

 

 

Community Support Team
Community Support Team

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

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
cooltechie
Level: Powered On

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

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?

cooltechie
Level: Powered On

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

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);

 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 215 members 4,446 guests
Please welcome our newest community members: