cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fishbicki
Helper II
Helper II

Text input box value to SharePoint list after pressing a button

Hello,

I have two text input boxes(datacards), "Name" and "Firm". I want the value of these to populate new rows on a SharePoint list, after pressing a button. How can this be done ?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@fishbicki 

Put this code in the OnSelect property of a button.  It will insert a new row in your SharePoint list with the data.

Patch(
    your_datasource_name,
    Defaults(your_datasource_name),
    {Name: TextInput_Name.Text, Firm: TextInput_Firm.Text}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@fishbicki 

Put this code in the OnSelect property of a button.  It will insert a new row in your SharePoint list with the data.

Patch(
    your_datasource_name,
    Defaults(your_datasource_name),
    {Name: TextInput_Name.Text, Firm: TextInput_Firm.Text}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Works wonderfully, thank You!

And a new question came - How in addition can that button clear the text fields after pressing it ?

or maybe an OnVisible sytax for the screen that resets the fields ?

 

*got it, in OnVisible: Reset(TextInput_Firm);;Reset(TextInput_Name) 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,049)