Implemented a component (simpler version) from this link: https://www.c-sharpcorner.com/article/progress-bar-component-in-powerapps
Component has three properties: items(Table) , activeStep(Text) , colors(Record)
1- items(Table)
Table(
{
Label: "stage x",
Id: 1,
Visible: true
},
{
Label: "stage y",
Id: 2,
Visible: true
},
... //more stages
)
2- activeStep(Text) I leave it blank or set to "" at component level
3- colors(Record)
{
StateActive: "#fde772",
StateDone: "#7ad568"
}
At component level set "Fill" property of circle in gallery to (I used Label instead of Id which makes it simpler)
ColorValue(
If(
And(ThisItem.Label = ProgressbarComponent.activeStep,ThisItem.Label = "stage y"),
ProgressbarComponent.colors.StateDone,
ThisItem.Label = ProgressbarComponent.activeStep,
ProgressbarComponent.colors.StateActive,
"Gray"
)
)
//activeStep is "" later set to ThisItem.activeStepListCol at screen where component added
But at screen the Fill property of Circle doesn't evaluates to the right value even though Progressbar.activeStep is now "ThisItem.activesStepListCol"
So instead of using "Progressbar.Id" from original linked blog in Color property of Circles added in gallery I used "Progress.Label = Progressbar.activeStep" . And at screen level I set the "Progressbar.activeStep" property to "ThisItem.activeStepListColumn"
What's the issue.. why does setting the component.activeStep at screen level not affect fill of circles?
@WarrenBelz @Drrickryp @BCBuizer @iAm_ManCat @LaurensM @TheRobRush @zmorek @EddieE @Ethan_R @timl @Pstork1 @Akser @Rusk @victorcp @JR-BejeweledOne @mmollet @BCLS776 @Shavar_Scott @SanshubhLubal @Tony_Bowes_BP @alaabitar @RusselThomas @Tony_Bowes_BP @zmansuri @golfnutt82 @Bilakanti @RJM07 @Tango @MJ84 @DGWolfe @Anonymous_Hippo @Anchov @KeithAtherton @amyharkus86 @Vaibhav_k @Anonymous @rubin_boer @Anonymous @Schwartz_Cory @MS_Gonzo @galos @Anonymous @Intoxicated @ash15 @Adrian_Celis @phipps0218 @Nat_SGRE @SolTeferi @Jean-Philippevb @TrayH
@EddieE
Hmmmmmm..... Components property set to a variable (vActiveStep) which is set later in screen does the job. But it also has to do with components scope setting i.e.
Settings > Upcoming features > Retired > "Collection access in component scope" needs to be turned off
And "Access app scope" in component's properties needs to be ON.
Thanks for the help!
The activeStep property is your issue, I believe. There's no direction in that blog on how to use it, which is poor, and if you're not sure how to go about this then you can come unstuck.
It sounds like you are using a gallery to try and set activeStep - which isn't working - but what you could try is this.
- In your component, set activeStep to a variable called vActiveStep. This will throw an error initially.
- then, back in your gallery, change the OnSelect to
Set( vActiveStep, ThisItem.activeStepListCol)
You will need to delete then re-add any components after this change.
I was able to get the above to work by adding the variable to activeStep, then adding a TextInput control and adding this code to the OnChange
Set( vActiveStep, Value(Self.Text))
I stayed with using ID - as per the blog - instead of Label like you've done, so there maybe some slight changes needed on your part.
@Akser I checked its not spelling or semantic related. Can you produce the same (create a component with said properties) at your end and confirm?
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional