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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Form Combobox.selected...
Power Apps
Answered

Form Combobox.selected.value doesn't pull value until after save

(0) ShareShare
ReportReport
Posted on by

I am using Dataverse & a Canvas App. A combobox (DataCardValue125) in my form is pulling from a second dataverse table one of the columns of which is Opportunity Status ID. Allow multiple selections is turned off on the combobox.

I am trying to use an if statement in the save button for the form to check whether this combobox has a particular value in it (wholenumber 10) in order to trigger an email (prior to saving the form)

I am using the following code to check the function before building the email:

 If(
 Text(DataCardValue125.Selected.'Opportunity Status ID') = Text("10"),
 Notify("working",ErrorSeverity.Moderate,1000));

My problem is that it doesn't work unless the form has first been saved. Any time the value 10 is selected for the first time in the combobox, if it hasn't been saved first, it won't trigger the if clause.

What code should I use to pull the value from the combobox (prior to saving the form) for comparison?

  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @BertP, use the ComboBox.OnChange property. 

     If(
     Text(DataCardValue125.Selected.'Opportunity Status ID') = Text("10"),
     UpdateContext({Opprt_Status_Ten: true})
    );

     

    Now trigger the email if the Opprt_Status_Ten = true

     

     


     

    If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.

    Visit my Blog: ahmedsalih.blog

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

  • BertP Profile Picture
    on at

    Thanks so much @AhmedSalih . Your solution definitely gets the if clause to work, so I'll mark the question as solved. My perplexity is that calling any other column works, eg.

    Text(DataCardValue125.Selected.'Opportunities Op Status')

    'Opportunities Op Status' is the unique ID column. Or I can call

    Text(DataCardValue125.Selected.Sort)

    Sort is another whole number column & it works consistently.

    it's just the one column which fails. I'll repost a modified question in the forums to cover this anomaly...

  • BertP Profile Picture
    on at

    And now, the original code has started to work perfectly:

     If(
     Text(DataCardValue125.Selected.'Opportunity Status ID') = Text("10"),
     Notify("working",ErrorSeverity.Moderate,1000));

    All I did was place the suggested code into the onchange of the combobox on the form. Then the code started to behave normally. I have since removed the code from the onchange of the combobox on the form, and it has continued to behave perfectly.

    I really don't know what to say about this except that it was a glitch & now it is gone...

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @BertP, sure, I will check it in the new post. Make sure to tell us what are the columns data types

  • BertP Profile Picture
    on at

    @AhmedSalihSo sorry for the delay... I only saw your post today.

     

    The problematic field in the form was a lookup field, the combobox of which had multiple selections disallowed (hence the code:

    DataCardValue125.Selected.'Opportunity Status ID'

    This lookup field drew from a table called "Opportunities Op Status", containing one text column: "Opportunity Status" and two whole number columns: "Sort" and "Opportunity Status ID."

     

    That said, the problem behaved like a glitch. For a while it was present, and then it disappeared (and the code worked)...

  • BertP Profile Picture
    on at

    @AhmedSalih 

     

    OK, so I discovered today that the code I had on my app (using the whole number column within the lookup field on the form) was indeed not working...

     

    For now, I have changed the if clause so that it tests a text column within the lookup field.

     

    This works fine. Does anyone else experience this behavior with number columns? Should I report to Microsoft?

  • goondenlel Profile Picture
    2 on at

    DELETE

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard