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 / Combobox is not gettin...
Power Apps
Unanswered

Combobox is not getting proper data from the Variable (Office365Users Connector)

(0) ShareShare
ReportReport
Posted on by 44

Hello everyone,

I ran into a weird issue and was hoping you could help. I don’t see anything wrong with my code at the moment, but I have checked multiple times and I’m scratching my head.

This is on the OnVisible property of the screen:

// Copying data from Connection to variable
UpdateContext({varUsers:     
    Filter(
        Office365Users.SearchUser({top: 999}),
        AccountEnabled
        && EndsWith(Mail, "@samplecompany.com")
        && Not(IsMatch(DisplayName, ".*\d.*"))
    )
})

This code stores the data into varUsers, and I checked the context variables under the same screen. It does have all the data I wanted.

Now, I set varUsers for the Item property of three comboboxes:


  • ComboBox1 item: varUsers

  • ComboBox2 item: varUsers

  • ComboBox3 item: varUsers

  •  

Here is the part I am struggling with:


  • ComboBox1 seems to ignore Not(IsMatch(DisplayName, ".*\d.*")) even though it is from the varUsers variable.

  • ComboBox2 and ComboBox3 seem to ignore all the filters except for AccountEnabled.

  •  

I tried this on another tablet and encountered the same issues. One of my colleagues tried the app and is seeing the same issue. If it matters, I am in my developer environment and do have access to the production environment.

I also tried this, but the same issues occurred:

// Copying data from Connection to variable
UpdateContext({varUsers:     
    Filter(
        Office365Users.SearchUserV2({top: 999}).value,
        AccountEnabled
        && EndsWith(Mail, "@samplecompany.com")
        && Not(IsMatch(DisplayName, ".*\d.*"))
    )
})

I also tried this, but the same issue persists:

// Copying data from Connection to variable
Set(varUsers,     
    Filter(
        Office365Users.SearchUser({top: 999}),
        AccountEnabled
        && EndsWith(Mail, "@samplecompany.com")
        && Not(IsMatch(DisplayName, ".*\d.*"))
    )
})
 

Thank you!

EDIT: Removed one line of code just in case for piracy concern.

Categories:
I have the same question (0)
  • Verified answer
    staronline1and2 Profile Picture
    44 on at
    I ended up asking copilot (bing.com) again. They told me to try all the steps which I already did. Then told me to use ClearCollect instead of UpdateContext or/and Set function. So I change it to what shown below.
     
    //Copying data from Connection to collection
    ClearCollect(colUsers,    
        Filter(
            Office365Users.SearchUser({top: 999}),
            AccountEnabled
            && EndsWith(Mail, "@samplecompany.com")
            && Not(IsMatch(DisplayName, ".*\d.*"))
        )
    );

    And change all three combobox items to colUsers and it is working as expected.
    This is what's solved my issue.
     
    For those are curious, this is message from copilot told me.
     

    "Collections in Power Apps can indeed handle data more efficiently in certain scenarios. Here are a few reasons why using a collection might help:


    1. Persistent Storage: Collections are stored in memory and can be accessed throughout the app, making them useful for managing data that needs to be reused across different screens or components.

    2. Performance: Collections can improve performance because they reduce the need to repeatedly query the data source. Once the data is loaded into a collection, it can be accessed quickly without additional calls to the server.

    3. Consistency: Using a collection ensures that the data remains consistent across different controls. Since the data is stored locally, it reduces the risk of discrepancies that might occur due to network latency or other issues.

    4. Flexibility: Collections offer more flexibility for manipulating and filtering data. You can easily add, remove, or update records in a collection, which can be useful for complex data operations.

    By using a collection, you might find that the data behaves more predictably and the filters are applied consistently across your comboboxes. Let me know if this helps or if you have any other questions! 😊"



     


     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard