cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
karlagb20
Helper III
Helper III

Populate Fields Answer based on another field

Hi,

I have these 4 drop down fields from a SharePoint list into a power apps form.

 

Status choices of 

100-90

87-70

69-50

49-30

29-0

Trend has choices of:

improving

stable

declining

 

VStatus has choices of

VTrend has choices of

I would like to populate another field based on selection for example if I select "49-30" from Status then the VStatus automatically shows ◔ as the answer.

If I select "Improving" from trend then VTrend automatically selects ⮝ as the answer. 

Can you please help me, right now I have them all as drop down choices.

 

Also VStatus I would like to color code it

● GREEN

LIGHT GREEN

YELLOW

LIGHT RED

RED

Form currently looks like this

 

PR.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @karlagb20 ,

Do you want to auto-populate the VStatus ComboBox based on the selected option within the Status ComboBox?

Do you also want to color the selected option within the VStatus ComboBox and VTrend ComboBox?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the DefaultSelectedItems property of the VStatus ComboBox to following:

If(
   EditForm1.Mode = FormMode.New,
   {
     Value: If(
               StatusComboBox.Selected.Value = "100-90",
               "●",
               StatusComboBox.Selected.Value = "87-70",
               "◕",
               StatusComboBox.Selected.Value = "69-50",
               "◑",
               StatusComboBox.Selected.Value = "49-30",
               "◔",
               StatusComboBox.Selected.Value = "29-0",
               "○"
            )
   },
   Parent.Default
)

 

Set the DefaultSelectedItems property of the VTrend ComboBox to following:

If(
   EditForm1.Mode = FormMode.New,
   {
     Value: If(
                TrendComboBox.Selected.Value = "improving",
                "⮝",
                TrendComboBox.Selected.Value = "stable",
                "⮞",
                TrendComboBox.Selected.Value = "declining",
                "⮟"
            )
   },
   Parent.Default
)

 

In addition, if you want to color the VStatus selection value, please try the following workaround:

Set the Color property of the VStatus ComboBox to following:

If(
       StatusComboBox.Selected.Value = "100-90",
       Color.Green,
       StatusComboBox.Selected.Value = "87-70",
       Color.LightGreen,
       StatusComboBox.Selected.Value = "69-50",
       Color.Yellow,
       StatusComboBox.Selected.Value = "49-30",
       RGBA(255,204,203,1),                           // Light Red
       StatusComboBox.Selected.Value = "29-0",
       Color.Red
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@karlagb20 

Put this code in the Default property of VStatus

 

Switch(
    Dropdown_Status.Selected.Value
    "100-90", "●",
    "87-70", "◕",
    "69-50", "◑",
    "49-30", "◔",
    "29-0", "○"
)

 

Similar idea for the Color property of VStatus

 

Switch(
    Dropdown_Status.Selected.Value
    "100-90", Green,
    "87-70", LightGreen,
    "69-50", Yellow,
    "49-30", RGBA(220, 153, 153, 1),
    "29-0", Red
)

 

This code can be used for the Default property of vTrend

 

Switch(
    Dropdown_Trend.Selected.Value
    "improving", "⮝",
    "stable", "⮞",
    "declining", "⮟"
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

v-xida-msft
Community Support
Community Support

Hi @karlagb20 ,

Do you want to auto-populate the VStatus ComboBox based on the selected option within the Status ComboBox?

Do you also want to color the selected option within the VStatus ComboBox and VTrend ComboBox?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the DefaultSelectedItems property of the VStatus ComboBox to following:

If(
   EditForm1.Mode = FormMode.New,
   {
     Value: If(
               StatusComboBox.Selected.Value = "100-90",
               "●",
               StatusComboBox.Selected.Value = "87-70",
               "◕",
               StatusComboBox.Selected.Value = "69-50",
               "◑",
               StatusComboBox.Selected.Value = "49-30",
               "◔",
               StatusComboBox.Selected.Value = "29-0",
               "○"
            )
   },
   Parent.Default
)

 

Set the DefaultSelectedItems property of the VTrend ComboBox to following:

If(
   EditForm1.Mode = FormMode.New,
   {
     Value: If(
                TrendComboBox.Selected.Value = "improving",
                "⮝",
                TrendComboBox.Selected.Value = "stable",
                "⮞",
                TrendComboBox.Selected.Value = "declining",
                "⮟"
            )
   },
   Parent.Default
)

 

In addition, if you want to color the VStatus selection value, please try the following workaround:

Set the Color property of the VStatus ComboBox to following:

If(
       StatusComboBox.Selected.Value = "100-90",
       Color.Green,
       StatusComboBox.Selected.Value = "87-70",
       Color.LightGreen,
       StatusComboBox.Selected.Value = "69-50",
       Color.Yellow,
       StatusComboBox.Selected.Value = "49-30",
       RGBA(255,204,203,1),                           // Light Red
       StatusComboBox.Selected.Value = "29-0",
       Color.Red
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,607)