cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kam1
Helper I
Helper I

PowerApps need to set a default value based on 4 other selections

Hi Everyone,

 

I am trying to build an app for our post department.

 

The app basically needs a default price setting based on the previous 4 dropdown selections.

The App has a postage list connected with all the pricing information which it looks ups and then submits all the information in another list.

 

The 4 dropdowns are:
Postage Type, Class, Format (Size), Weight

 

I have managed to get the PowerApp to populate the information in the dropdowns however the price I think looks up the weight data and picks the first choice that it finds. (not looking up the other information).

 

On the Price dropdown I have added the following formula: 

Distinct(Filter('Postal service prices', Weight = Dropdown5_1.Selected.Result),Price)

and am aware that the issue starts here possibly as it only looks up weight.

 

Is there a way to make it lookup the above 4 columns and then pick the correct price? We had an Info Path form that was able to do this however need to move this to a PowerApp now.

 

Thanks in anticipation

 

Kam

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User II
Super User II

Hi @Kam1 

In the OnStart of the app put this formula

 

Concurrent(
Collect(type,Sort(Distinct('Postal service prices','Postage Type),Result),
Collect(clas,Sort(Distinct('Postal service prices',Class),Result), 
Collect(size,Sort(Distinct('Postal service prices', 'Format (Size)'),Result),  
Collect(wgt,Sort(Distinct('Postal service prices','Weight'),Result) 
)

 

Set up the 4 dropdowns with items properties as type, clas, size and wgt respectively.

Put a label on the screen and set the Text property to 

 

Lookup(
        'Postal service prices', 
           AND(
               'Postage Type' = Dropdown1.Selected.Result, 
                Class = Dropdown2.Selected.Result,
               'Format (Size)' = Dropdown3.Selected.Result,
               Weight = Dropdown4.Selected.Result
            ), "Price"
)

 

 

 

View solution in original post

2 REPLIES 2
Drrickryp
Super User II
Super User II

Hi @Kam1 

In the OnStart of the app put this formula

 

Concurrent(
Collect(type,Sort(Distinct('Postal service prices','Postage Type),Result),
Collect(clas,Sort(Distinct('Postal service prices',Class),Result), 
Collect(size,Sort(Distinct('Postal service prices', 'Format (Size)'),Result),  
Collect(wgt,Sort(Distinct('Postal service prices','Weight'),Result) 
)

 

Set up the 4 dropdowns with items properties as type, clas, size and wgt respectively.

Put a label on the screen and set the Text property to 

 

Lookup(
        'Postal service prices', 
           AND(
               'Postage Type' = Dropdown1.Selected.Result, 
                Class = Dropdown2.Selected.Result,
               'Format (Size)' = Dropdown3.Selected.Result,
               Weight = Dropdown4.Selected.Result
            ), "Price"
)

 

 

 

View solution in original post

Kam1
Helper I
Helper I

Hi @Drrickryp 

Sorry for the late response, I have been ill and just returned back to work.

 

A colleague of mine took over this whilst I was off and what he did was on the price column, he added a filter for each of the options so that it looks up the actual row and gets the price information.

 

Just want to say thank you for replying to my post. I would have tried this, however the user's seem happy with the current fix so will bare this in mind if I ever do something similar

 

Best Regards

Kam

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 Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (53,700)