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 / How to update combobox...
Power Apps
Unanswered

How to update combobox value in a form based on gallery count?

(0) ShareShare
ReportReport
Posted on by 61

Hi Team,

I have a Gallery control in app and i am storing the total number of rows of that gallery in a label control. Now i need to change the combobox value of a form based on the value in the label control..

In label control text property : CountRows(Gallery1.AllItems);

In defaultSelectedItems of combobox: If(Value(label.Text)<=2,{Value:"Choice 1"},If(Value(label.Text}>2,{Value:"Choice 2"},ThisItem.Status));

This is circular reference error.

Any other way to achieve this?

Any help would be appreciated.

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Kiruthika22 ,

     

    Please check the gallery's items property and put into this formula(replace the GalleryItems)

     

    With(
    {CountItems:CountRows(GalleryItems)},
    If(
    Value(CountItems)<=2,
    {Value:"Choice 1"},
    Value(CountItems)>2,
    {Value:"Choice 2"},
    ThisItem.Status
    )
    )

     

    Best Regards,

    Bof

  • Kiruthika22 Profile Picture
    61 on at

    Hi @v-bofeng-msft ,

    Thanks for your reply. Does the above code update the combo box value in the form?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Kiruthika22 ,

     

    You could try. Because I know limited information, there is no 100% certainty that this is useful. If this formula doesn't work, I suggest you consider providing some screenshots and more detailed descriptions.

     

    Best Regards,

    Bof

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard