cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GeekAlf_Pro
Resolver I
Resolver I

UpdateContext issue

Hi,

 

i've got a combobox in 1 and a label in 2

 

image.png

in the OnChange Property, i've set an UpdateContext

CountRows(gal_CodeSerie.AllItems)

The trouble is that the on change run before the gallery change, so it's refreshed....after....

 

how can i get the information of the number of rows as soon as the combo changes ?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @GeekAlf_Pro ,

 

Please try this:

1\ Add a Timer control and set its OnTimerEnd property to:

Set(Nb_items_mesure; CountRows(gal_CodeSerie.AllItems))

// Delete the formula on the onchange property of the combo box control

 

2\ Set other propertites of the timer control like picture:

v-xiaochen-msft_0-1617241220205.png

 

3\ Set the label control's Text property to:

Nb_items_mesure

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

11 REPLIES 11
v-xiaochen-msft
Community Support
Community Support

Hi @GeekAlf_Pro ,

 

Do you mean that the countrows() function was executed before the data in the library was changed?

 

If my understanding is correct, you could try this formula on onchange property of combo box control:

Set(Thevar,CountRows(your Items formula of 'gal_CodeSerie'))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

 

 

hi @v-xiaochen-msft ,

 

thanks for your time, i've tried your suggest, but, with the same behaviour.

sometimes the var is refreshed, sometimes not.

 

v-xiaochen-msft
Community Support
Community Support

Hi @GeekAlf_Pro ,

 

Could you provide some formulas or pictures to explain its behavior?

 

Best Regards,
Wearsky

yes,

 

i set the screen on visible property and the combo on change property both as follow

Set(Nb_items_mesure; CountRows(gal_CodeSerie.AllItems))

and here it is a gif of the behavior

 

combo behavior.gif

Jagadeeshk
Responsive Resident
Responsive Resident

Use refresh(datasource); 2 3 times, so that the code will delay before start count.

hi @Jagadeeshk ,

 

i tried your suggest but with the same behavior.

 

Jagadeeshk
Responsive Resident
Responsive Resident

Can you pls share steps scrn shot?

v-xiaochen-msft
Community Support
Community Support

Hi @GeekAlf_Pro ,

 

Please try this:

1\ Add a Timer control and set its OnTimerEnd property to:

Set(Nb_items_mesure; CountRows(gal_CodeSerie.AllItems))

// Delete the formula on the onchange property of the combo box control

 

2\ Set other propertites of the timer control like picture:

v-xiaochen-msft_0-1617241220205.png

 

3\ Set the label control's Text property to:

Nb_items_mesure

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

Hi @GeekAlf_Pro ,

 

Use this code logic. put it in the Text Label

CountRows( Filter(Your Data Source, columnName = ComboBox.Selected.value) )

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,482)