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 / Can't update Global va...
Power Apps
Answered

Can't update Global variable from form control OnSelect Method

(0) ShareShare
ReportReport
Posted on by 26

Hey Guys,

 

I've come back around on this problem many times now so thought I'd just ask.

 

I have a patched form control that progresses through multiple parts of a data source. I'm trying to get a dropdown in the form control to update a global variable, using a simple Set(dummyVar, "test") on the dropdown field's OnChange method but despite testing everything I can think of, it never seems to update the variable.

I've tried:

1: OnChange

2: OnSelect

3: UpdateContext()

4: Set()

But nothing seems to be able to get information out of the form control and into the global scope state. Is my approach wrong here? I can't seem to get the OnSelect or OnChange methods on the form dropdown to do literally anything....ever and it is incredibly frustrating.

 

Ideally I would have the following code on the OnSelect method for the form control dropdown:

 

If(
    IsMatch(DropdownValue.Selected.Value,"type 3 for something"),
    Set(
        variant, "v3"

    )

)

 

But even without the condition, a naked Set(var, "test") doesn't do anything either when I choose something in the dropdown.

 

Any suggestions would be appreciated.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @Fonyx ,

    You certainly should be able to set the Variable on the OnChange of the drop-down

    If(
     IsMatch(
     Self.Selected.Value,
     "valid match here"
     ),
     Set(
     variant, 
     "v3"
     )
    )

    are you saying this does not set?

     

    WarrenBelz_1-1641796511137.png

    Variant.gif

    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.

    Visit my blog Practical Power Apps

  • Fonyx Profile Picture
    26 on at

    Hey @WarrenBelz 

     

    Thanks for the quick response. Yes, that doesn't seem to set the variable. The only things that could be affecting my verion are:

    1: My dropdown is connected through a form

    2: My form is broken into seperate components for a patch submission over multiple pages as it is a big form

    3: I am using a dropdown data input inside the data card which originally tried to use a combo box. To make defaults easier I set the combo box to invisible, and manually connected a dropdown in it's place.

     

    Could any of these hinder my ability to expose the selected choice in the dropdown to a global variable.

     

    Right now I can't even get a label (placed externally to the form section) to display the selected value of the drop down selected value. It seems that my form doesn't want to broadcast anything about what it's doing to the global state. Have you seen this before?

  • Verified answer
    WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @Fonyx ,

    Firstly, read this post regarding known bug that seems to be escalating to further things. The issue I believe you have is the same - communicating things from inside to card to outside, however I just did a test here on a combo box inside a form and it set the Variable as expected. I then put a drop down in the same card and it also worked.

    Please do a bit of experimenting with a new form and if it works, see what is different as this bug seems to be random.

  • Fonyx Profile Picture
    26 on at

    Hey Warren,

    I just did a quick test on a fresh app and it shows the state of the dropdown in a label outside the form as I would like. It does seem like I've either stepped into a bug or gotten the app into an unstable state somehow. Since your test with overriding the combo with a dropdown still works it might be related to the patching of the form or some stateful issue with contexts and globals. Either of these problems seems like a product issue though. Thanks for your help. 

  • Fonyx Profile Picture
    26 on at

    Just adding more details to this bug.

    The above problem occurs when using a sharepoint datasource. If the app is created normally, this problem appears where you can't extract the form details to a label, context variable or global....but if you create the app from the sharepoint Integrate->PowerApps->Create an App (resulting in a mobile template canvas app by default) this problem goes away. My conclusion is that there is some configuration difference between a typical user created app, and the system creation of an integrated app. Just to help with bug fixes down the line.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard