cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jesp8789
Level: Power Up

Edit a Cell in Excel with powerapps

Hello

 

I am currently working on an App in PowerApps but I am running into some issues. I do not have much experience with PowerApps nor with programming in general. I have to search for a specifix cell in an Excel table and update the cell beside it, when I push a button.

 

An expample: 

My table is called "Printer_Toners"

The collumn where I have to search is called "Toners" and the collumn where I have to edit is called "Stock".

 

I now have to search for the toner called "CF280X" (marked red) and when I push a button it has to update the cell beside it (in the "stock" column, marked blue) by taking the current number and minus it with 1 (x-1).

 

Tabel.JPG

 

How can I do this?

 

Thanks in advance!

 

Kind Regards

Jesper 

4 REPLIES 4
Microsoft dinusc
Microsoft

Re: Edit a Cell in Excel with powerapps

Hello jesp8789,

This should be possible. I assume you have an application with an EditForm control (EditForm1 for example) that is bound to your Excel file. If so then try the following:

 

1. Click on the form data card that contains the Toner Count field. The card should have a Text Input control that displays the Toner Count value. Note the data card name from the Advanced Panel on the right (for example Toner_DataCard2)

2. Select the Screen that contains your form (for example EditScreen1)

3. Set EditScreen1.OnVisible = UpdateContext({count:Toner_DataCard2.Default}) Here the Toner_DataCard2 is the card name from step 1 and EditScreen1 is the screen name. Those may be different in your case.

4. Select the card again and unlock it from the Advanced Panel (the lock icon that says "Unlock to change properties)

5. Select the Text Input control that displays the Count value. Its default value must be set to something like "Parent.Default". Set it to count (the value from step 3): 

6. Add a button Control to the same card. Set Button.Text = count. Now yhou should have a Text Input control and a Button control that show the same value

7. Set Button.OnSelect = UpdateContext({count: count - 1});SubmitForm(EditForm1)

Now, clicking on the button should decrease the count value and submit the changes in one step. Note that you could hide the Text Input control and style your button as you whish. 

 

 

Himself
Level: Power Up

Re: Edit a Cell in Excel with powerapps

Hi

 

I also have the same problem - i am unable to fix it with you solution, are you sure it's working ?

Highlighted
Super User
Super User

Re: Edit a Cell in Excel with powerapps

Hello,

I am not working with excel but you can try this:

If Stock items are strings:
Patch(Printer_Toners,LookUp(Printer_Toners,Toners="CF280X"),{Stock:Text(Value(Stock)-1)})

If Stock items are numbers:
Patch(Printer_Toners,LookUp(Printer_Toners,Toners="CF280X"),{Stock:Stock)-1})

jesp8789
Level: Power Up

Re: Edit a Cell in Excel with powerapps

Hello

 

It's not working the way I wanted it yet. I am currently working on a different solution, and it seems to be working at the moment. I will let you know as soon as I am finished with the App.

 

Kind regards

Jesper 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,587)