cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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
Highlighted
Helper IV
Helper IV

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

 

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User II
Dual Super User II

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

 

 

Highlighted
Community Support
Community Support

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.
Highlighted
Helper IV
Helper IV

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?

Highlighted
Helper IV
Helper IV

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

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,966)