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

Adding the value from a TextInput to a column in SharePoint

Hi, I'm trying to do a simple exercise with PowerApps and I'm blocked. Would be great if someone can give some hints. 

 

I've a TextInput box where I type in a number (Updated TextInput1.Format = Number).

Then I'have a button where I add the number to a column [MyNumber] in SharePoint List [MySPList]

 

I've tried to use PATCH directly but it failed

 

Patch(MySPList,Defaults(MySPList),MyNumber:TextInput1})

 

 

I understand I need to do a previous step storing the value from the TextInput1 in a Var and then do the Patch but it doesn't work either. In this case the problem is the var is stored as a "control" type instead of a number.

 

UpdateContext({TextInputVar:TextInput1);
Patch(MySPList,Defaults(MySPList),MyNumber:TextInputVar);

 

 

If I change TextInput1.Format = Text then it stores the number but as a "text" type and therefore the Patch doesn't work. 

Image below with an example of the two types I get.

 

Capture.JPG

 

 

 

 

 

 

Any idea on how can I solve this Issue? I believe it should be something really simple but It seems I go round in circles... 

Many thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Adding the value from a TextInput to a column in SharePoint

Hey @Sam4 try this:

Patch(
    MySPList,
    Defaults(MySPList),
    {MyNumber: Value(TextInput1.Text)}
)


PowerApps can get a bit persnickety about text and, even though the text input can only take numbers, it will treat it as a text input if you don't wrap it in a Value function, which makes sure it is a number.  

 

Let me know if that works for you! If not, let me know and I'll happily follow up!

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Adding the value from a TextInput to a column in SharePoint

Hey @Sam4 try this:

Patch(
    MySPList,
    Defaults(MySPList),
    {MyNumber: Value(TextInput1.Text)}
)


PowerApps can get a bit persnickety about text and, even though the text input can only take numbers, it will treat it as a text input if you don't wrap it in a Value function, which makes sure it is a number.  

 

Let me know if that works for you! If not, let me know and I'll happily follow up!

View solution in original post

Sam4
Level: Powered On

Re: Adding the value from a TextInput to a column in SharePoint

Awesome :). That works!

 

Many thanks

Super User
Super User

Re: Adding the value from a TextInput to a column in SharePoint

Happy to be able to help! Feel free to @ me if I can assist with anything in the future! 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,835)