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.

View solution in original post

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.

View solution in original post

julius0216
Level: Power Up

Re: Need help making a cost estimator

I will look into this. thanks alot.

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 (Last 30 Days)
Users online (4,913)