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

Doing operations with table number and textimput number

Hi all, 

I want to substract a number from a table. This number is added by the user so I want to substract to my initial number of the table this user's number. This operation must be in a button with the submitform of more things to the table I've got.

I add an image to try to explain it.

Lots of thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Doing operations with table number and textimput number

Hi @AlesonITC,

 

  • On your edit form, remove the lock from your quantity card. 
  • Change the name of the data key card label to "Quantity Remaining"
  • Add a slider control to the card and set its properties as follows: Default 0, Max ThisItem.Quantity, Min 0
  • Add another Label to the card and set the Text property to "Amount Purchased".  Add a second label and set its Text property to Slider1.Value. 
  • Have the Add Sale button On Select property be SubmitForm(Form1)
  • Now when you submit the form, the DataTable will reflect the post sale inventory quantity.

When new items come in, you can adjust the inventory by putting the correct quantity now in stock into the TextInput Control and click the button.  The new total will be reflected in the Datatable.

View solution in original post

7 REPLIES 7
AlesonITC
Level: Powered On

Re: Doing operations with table number and textimput number

I am trying something like this:

 

SubmitForm(Form1);;UpdateContext(DataTable2.Selected.Quantity = DataTable2.Selected.Quantity - Value(TextInput1.Text));;ResetForm(Form1)

But it doesn't work

AlesonITC
Level: Powered On

Re: Doing operations with table number and textimput number

No one can help me? Smiley Sad

Community Support Team
Community Support Team

Re: Doing operations with table number and textimput number

Hi @AlesonITC,

 

Which part is the form that you are trying to submit? In below image, the blue part or the yellow part? It seems to me that the blue part is the edit form and yellow part is a data table control. Is that true?

 

Capture.PNG

 

If so, what is the data source of the data table? Is it the same one as the edit form? I assume that there should be 2 different data sources, since in your screenshot, both data table and form have the same column named Quantity, but the values are different.

 

Selecting Add Sale would update the records from edit form(DataSource1), but it won't change the data in data table(DataSource2). 

 

Please explain your situation more clearly so that we could help.

 

Regards,

Mona

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

Re: Doing operations with table number and textimput number

Hi @v-monli-msft thanks for answer, the thing I'm trying to do is update the number which I select to make the insert of the sale and substract the quantity number  of the textImput (the blue part, the number 3) to the DataTable on the conection to SQL server, and then update this showTable (yellow part).

 

Doing this, I would get a number 7 on watermelon after a refresh of the datatable.

 

The app works:

1.- Tap or select an employee

2.- Tap or select a fruit

3.- Write the number of fruits that vendor sells to a client.

4.- Submit form, it saves on a SQL Table the vendor id, the fruit id, the date and the number of fruits sold.

5.- Update the table substracting the number of fruits to the old number.

 

It works all nice but the last point. I don't know what function use, tried with update, patch, updatecontext...

 

Lots of thanks

 

AlesonITC
Level: Powered On

Re: Doing operations with table number and textimput number

Anyone can help me please? 

I will be very grateful.

Thanks.

Highlighted
AlesonITC
Level: Powered On

Re: Doing operations with table number and textimput number

Still need help please Smiley Sad

Super User
Super User

Re: Doing operations with table number and textimput number

Hi @AlesonITC,

 

  • On your edit form, remove the lock from your quantity card. 
  • Change the name of the data key card label to "Quantity Remaining"
  • Add a slider control to the card and set its properties as follows: Default 0, Max ThisItem.Quantity, Min 0
  • Add another Label to the card and set the Text property to "Amount Purchased".  Add a second label and set its Text property to Slider1.Value. 
  • Have the Add Sale button On Select property be SubmitForm(Form1)
  • Now when you submit the form, the DataTable will reflect the post sale inventory quantity.

When new items come in, you can adjust the inventory by putting the correct quantity now in stock into the TextInput Control and click the button.  The new total will be reflected in the Datatable.

View solution in original post

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
Users Online
Currently online: 331 members 6,661 guests
Please welcome our newest community members: