web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default Value Based on...
Power Apps
Answered

Default Value Based on another field

(0) ShareShare
ReportReport
Posted on by 66

I am trying to set the default field of Risk Rating based on the values of Risk likelihood and Risk Consequence as seen below.

 

I have tried the solutions from other posts on here but I really couldn't get it to work. 

 

ChristopherWood_0-1715356064400.png

 

Anyone able to help me?

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    "couldn't get it to work" is not very descriptive @ChristopherWood

     

    1. What formula are you currently using?
    2. What is the error message?
    3. How many risk ratings are there?
  • ChristopherWood Profile Picture
    66 on at

    @Amik 

    Please see below formula.

    The risk L is a dropdown 1-5

    The risk C is a dropdown 1-5

    The risk Rating is Low, Medium, High

     

    I want to get the risk rating to change based on the numbers selected in Risk L and Risk C

     

    The errors show there is no option for Low, even though there evidently is. 

    ChristopherWood_0-1715366129884.png

     

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @ChristopherWood - you have not defined how the Risk Rating should be calculated based on the sum of the Likelihood and Impact Scores.

     

    There are many ways to achieve what you're trying to do. Here is one way:

     

    Create a Collection which maps out what the rating should be per score (or ideally create a new table in your data source with this mapping, then load the table into your app):

     

    ClearCollect(
     col_ratings_map,
     Table(
     {
     Score: 2,
     Rating: "Low"
     },
     {
     Score: 3,
     Rating: "Low"
     },
     {
     Score: 4,
     Rating: "Medium"
     },
     {
     Score: 5,
     Rating: "Medium"
     },
     {
     Score: 6,
     Rating: "Medium"
     },
     {
     Score: 7,
     Rating: "Medium"
     },
     {
     Score: 8,
     Rating: "High"
     },
     {
     Score: 9,
     Rating: "High"
     },
     {
     Score: 10,
     Rating: "High"
     }
     )
    )

     

    Assuming you are indeed using Dropdown controls and not ComboBox controls, I assume the Items property contains numbers. E.g.:

     

    [
     1,
     2,
     3,
     4,
     5
    ]

     

    On the Default property of the Risk Rating Dropdown control, enter:

     

    With(
     {
     sum_selected: Sum(
     DropdownL.Selected.Value,
     DropdownC.Selected.Value
     )
     },
     LookUp(
     col_ratings_map,
     Score = sum_selected,
     Rating
     )
    )
  • Meekou Profile Picture
    on at

    You should pass "Low" and "Hight" instead of [Low], [High].

    Here a sample demo:

     

    Default:
    	If(Dropdown1.Selected.Value = 4, "Low", "High")
    Items:
    	["Low", "Medium", "High"]

     

  • ChristopherWood Profile Picture
    66 on at

    @Amik 

    Looking at these closer it is a "combobox" function on all of this stated options. 

    Please see below the error I get - I placed this in the "defaultselecteditems" I assume this is correct.

     

    ChristopherWood_0-1715586748645.png

     

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @ChristopherWood - A ComboBox control works differently. 

     

    You can either use:

     

    With(
     {
     sum_selected: Sum(
     DataCardValue15.Selected.Value,
     DataCardValue16.Selected.Value
     )
     },
     {
     Value: LookUp(
     col_ratings_map,
     Score = sum_selected,
     Rating
     )
     }
    )

     

    Or:

     

    1. Update the Items property to:

     

    col_ratings_map

     

    2. Use the LookUp function on the DefaultSelectedItems property:

     

    With(
     {
     sum_selected: Sum(
     ComboBox7.Selected.Value,
     ComboBox8.Selected.Value
     )
     },
     LookUp(
     col_ratings_map,
     Score = sum_selected
     )
    )
  • ChristopherWood Profile Picture
    66 on at

    Thanks, worked fantastic! 

    And I learnt something new Cheers!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard