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 / If value then combobox
Power Apps
Unanswered

If value then combobox

(0) ShareShare
ReportReport
Posted on by 155

Hi,

 

Im hoping someone could help with something simple.  I want to have a combo box which Is dependant on the value calculated in a different box.  I just cant get it to work.

 

Im assuming it would be something like this?

 

If(Label14.Text>"20",DataCardValue264.SelectedItems="Suspension",DataCardValue264.SelectedItems="Pass")

 

Could someone possibly help with this

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @TBODEN,

     

    What column type is the combobox displaying and what datasource are you using? As an example I will use a SharePoint single-select choice column:

    //Write the following code in the DefaultSelectedItems property
    If(
     Value(Label14.Text) > 20,
     {Value: "Suspension"},
     {Value: "Pass"}
    )

     

    As a note: you can't affect other properties by using 'DataCard...SelectedItems = "Suspension"'. In order to change the SelectedItems of that DataCard you will have to use conditional logic within that specific property (as is shown in the code above) or by using e.g. variables. 

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • TBODEN Profile Picture
    155 on at

    Hi,

     

    Ive put this in but it now errors stating its a circular argument, im not sure how thats possible though?

     

    If(Value(Label14.Text)<20,{value:"Pass"},{value:"Suspension"})

  • LaurensM Profile Picture
    12,516 Moderator on at

    @TBODEN,

     

    The circular argument error should point you in the direction of the issue via the error description. Please make sure that the combobox does not directly affect the label, otherwise this will result in a circular reference.

     

    Do you have any custom logic within some of the label's properties?

  • TBODEN Profile Picture
    155 on at

    TBODEN_0-1710189805767.png

    Any thoughts, i cant see where the circular issue is, its all dependent on one text box that isnt influenced by the combo box in any fashion, if i create a separate combo box then the formula works, the form one just wont work for some reason

  • LaurensM Profile Picture
    12,516 Moderator on at

    @TBODEN,

     

    Would it be possible to check the label14 properties for any code that is dependent on your combobox? It may be beneficial to temporarily try this approach with another label and slowly add the existing label14 to see where the error occurs.

     

    The code originally written in your question - is this still code that exists within your Label? This should be removed.

     

    I hope this helps!

  • TBODEN Profile Picture
    155 on at

    When i strip out the output box and just use a manual value it starts to work,   As it stands a separate "list" generates the 5 values at the top, a separate text box then calculates that average.  Dependant on the output a second text box calculates the deviance from that average.  That is what i wanted referenced within the results but it seems inputing that value counts as circular when it affects something within the same form.  Can you think of anyway around this?

  • LaurensM Profile Picture
    12,516 Moderator on at

    @TBODEN,

     

    I may be missing some context but at first sight the dropdown indeed does not seem to be related to the label. Does the same issue occur when you add a new label (e.g. 15) and transfer the logic of label 14 to that one, after which you reference the new label within the combobox?

     

    Does the combobox affect one of the fetched 'list' values or calculations in any way? (e.g. recalculation after a combobox value change) Since the solution works when not using the Output text input, in what way does this text input affect your calculations and/or is it linked to the combobox?

  • TBODEN Profile Picture
    155 on at

    Theres no link that I can find that should affect the value in a circular manner, weirdly if I create a textinput box and set it up independently from the form it all works, strangely I can then get the form to mirror the values in the other boxes and it is all displayed correctly, just a bit faffy

  • Shravyashree_01 Profile Picture
    174 Moderator on at

    Hi @TBODEN , you can write the below code in the DefaultSelectedItems property of the combobox

    If(Value( Label14.Text)>20,["Suspension"],["Pass"])

    Please note its a hardcoded value which is not from the datasource of the combobox

    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.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard