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

Auto Populate a text field based on values in TWO dropdown fields

Hi everyone, I have a SharePoint list connected to my PowerApps form.  The list has three columns:

Impact Level

Likelihood

Outcome

There are values entered for each cell so as an example Impact Level can be 1, and Likelihood can be 5.  Both Impact Level and Likelihood are pulling values nicely into PowerApps.  What I want is for the Outcome field to automatically be populated once the user selects the relevant Impact Level and Likelihood.  So in the example above if I select 1 for Impact Level and 5 for Likelihood, Outcome will show a value in the field Medium (5).  The SharePoint list has about 20 records in it, so Outcome will be different depending on the Impact and Likelihood selected.  Any advice on how this can be easily achieved?

 

1 ACCEPTED SOLUTION

Accepted Solutions

@joshieboy ,

Please forget about SharePoint calculated columns - they are for SharePoint and cause all sorts of issues in Power Apps - I have done a blog on this subject.

As for the code, I do not know the Items of your drop-downs (I will refer to the output as xxxx here (this blog section will assist), but the Default of the text box would be something like

Lookup(
   YourReferenceList,
   'Impact Level' = YourddImpact.Selected.xxxx &&
   Likelihood = YourddLikelihood.Selected.xxxx
).Outcome

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

8 REPLIES 8
Super User III
Super User III

Hi @joshieboy ,

I do exactly the same thing in our daily risk assessments. I have a simple reference table with all the combinations on Impact Level, Likelihood and Outcome (we have different names for these) and two dropdowns (both Distinct filters)

Outcome is equal to

Lookup(
   ReferenceList,
   Impact = ddImpact.Selected.Result &&
   Likelihood = ddLikelihood.Selected.Result
).Outcome

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi Warren, thanks for the feedback.  This is exactly what I would like to accomplish.  It is a Risk Matrix as per attached screenshot.  I am not sure I totally follow the formula.  I understand the Lookup reference list - which is the SharePoint List but am not sure I follow after that.  Can you take a look at my screenshot and advise.  Thanks.  I have an Impact Level field, a Likelihood field and they are both dropdowns, so once someone selects the relevant combination the Outcome will automatically display in a text field.

Helper I
Helper I

Have you considered using a SharePoint calculated column with the Choose function and nested IFs?

Pat

I've never tried that before.  I'm thinking that the lookup function will be easier to implement but got stuck along the way

Helper I
Helper I

Hi Joshie,

I've added some comments to warrens code to try and help you understand. you would place this code in text property of the label you want to display the outcome

Lookup(
   ReferenceList,
//Lookup Sharepoint List
   Impact = ddImpact.Selected.Result &&
//Match Impact Column with value selected in dropdown1 
   Likelihood = ddLikelihood = ddLikelihood.Selected.Result
//Match Likelhood Column with value selected in dropdown2 
).Outcome
//Display the outcome value in the row that was matched


 

@joshieboy ,

Please forget about SharePoint calculated columns - they are for SharePoint and cause all sorts of issues in Power Apps - I have done a blog on this subject.

As for the code, I do not know the Items of your drop-downs (I will refer to the output as xxxx here (this blog section will assist), but the Default of the text box would be something like

Lookup(
   YourReferenceList,
   'Impact Level' = YourddImpact.Selected.xxxx &&
   Likelihood = YourddLikelihood.Selected.xxxx
).Outcome

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Thanks for this @BlessedCobba  - it helped.  Solution works now.  Appreciate it. 

Thanks very much for this @WarrenBelz  - the solution works like a charm now.  Appreciate your time and patience.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Top Solution Authors
Top Kudoed Authors
Users online (65,990)