cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jesp8789
New Member

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
dinusc
Microsoft
Microsoft

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. 

 

 

Hi

 

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

Mike8
Solution Sage
Solution Sage

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
New Member

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,041)