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

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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.

2 REPLIES 2
PowerApps Staff CarlosFigueira
PowerApps Staff

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.

julius0216
Level: Power Up

Re: Need help making a cost estimator

I will look into this. thanks alot.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 177 members 4,828 guests
Please welcome our newest community members: