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

Community site session details

Session Id : 3JFfSbUysSOvVmjjB0IlrL
Power Apps - Microsoft Dataverse
Answered

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

Like (0) ShareShare
ReportReport
Posted on 6 Mar 2024 10:56:15 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?

I have the same question (0)
  • goondenlel Profile Picture
    2 on 08 Apr 2024 at 22:25:46
    Re: Form Combobox.selected.value doesn't pull value until after save

    DELETE

  • BertP Profile Picture
    on 08 Apr 2024 at 21:59:47
    Re: Form Combobox.selected.value doesn't pull value until after save

    @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?

  • BertP Profile Picture
    on 06 Apr 2024 at 23:25:10
    Re: Form Combobox.selected.value doesn't pull value until after save

    @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)...

  • AhmedSalih Profile Picture
    6,678 Moderator on 07 Mar 2024 at 12:08:55
    Re: Form Combobox.selected.value doesn't pull value until after save

    @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 07 Mar 2024 at 01:07:13
    Re: Form Combobox.selected.value doesn't pull value until after save

    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...

  • BertP Profile Picture
    on 07 Mar 2024 at 00:15:56
    Re: Form Combobox.selected.value doesn't pull value until after save

    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...

  • Verified answer
    AhmedSalih Profile Picture
    6,678 Moderator on 06 Mar 2024 at 19:54:00
    Re: Form Combobox.selected.value doesn't pull value until after save

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Featured topics

Loading complete