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

Need help making a cost estimator

I want to when i press a button "Add" (Lägg till) it will add the value in the box to the left (7) to a value which will then be presented in the text input on the top (Summa [TEXT INPUT] kr). How do i do this? I will add more products to the list which will then also be added in the same way. But what code on the button do i need to put in?

Untitled-3.gif

 

Also I will need a button to reset the value. Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Need help making a cost estimator

You can use a variable that represents the default value of that text input, which you can initialize to 0 (such as on the screen's OnVisible property) - and you can also use a button to set that value back to zero, resetting the value.

Screen.OnVisible: UpdateContext({ value: 0 })
SummaTextInput.Default: value
ResetButton.OnSelect: UpdateContext({ value: 0 })

On the list of items, I'm assuming you have them in a gallery. If the value (in krona) is represented by the column 'Value', then you can have this formula in the Lägg till button:

LaggTillButton.OnSelect: UpdateContext({ value: value + ThisItem.Value })

That will update the 'value' variable, and its value will be reflected on the text input.

View solution in original post

2 REPLIES 2
Highlighted
Power Apps
Power Apps

Re: Need help making a cost estimator

You can use a variable that represents the default value of that text input, which you can initialize to 0 (such as on the screen's OnVisible property) - and you can also use a button to set that value back to zero, resetting the value.

Screen.OnVisible: UpdateContext({ value: 0 })
SummaTextInput.Default: value
ResetButton.OnSelect: UpdateContext({ value: 0 })

On the list of items, I'm assuming you have them in a gallery. If the value (in krona) is represented by the column 'Value', then you can have this formula in the Lägg till button:

LaggTillButton.OnSelect: UpdateContext({ value: value + ThisItem.Value })

That will update the 'value' variable, and its value will be reflected on the text input.

View solution in original post

Highlighted
New Member

Re: Need help making a cost estimator

I will look into this. thanks alot.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,405)