Hi guys
I have an app where I'm trying to add badges as gamification for my users.
My app allows the users to input time coached for their employees.
I have a collection called "FlashCol" that is capturing all the data inputted from users.
It captures who they coached, and how long. My SharePoint has that captured as a column called "Time"
I wanted the badge to turn visible if any of their sessions get inputted with a time of 1 minute.
I've tried a ton of variations of the following to get my badge picture to turn visible. No luck.
Where am I going wrong? I get the x with "invalid argument type"
This is what I have for the Visible for the picture: If(FlashCol.Time=1,true,false)
Solved! Go to Solution.
Hi @smartin ,
Where do you want to display the icon?
I assume that you want to display the icon in a gallery.
Sine FlashCol.Time is a field, you couldn't compare it with a value directly.
I recommend you use the function of Lookup to get value from a field.
You could try this formula:
If(LookUp(FlashCol,Title=ThisItem.Title,Time)>1,true,false)
Best regards,
Community Support Team _ Phoebe Liu
Hi @smartin , my approach would be to create a variable, like a local variable UpdateContext({locWithinOneMinute: false}).
The Visible property of the badge should be just this variable locWithinOneMinute
When appropriate, change the value of the variable to true with the UpdateContext statement, which would make the badge visible.
Good luck!
Hi @smartin
I think the issue here is that a collection is a structure that contains multiple rows, and that's the reason why an expression like "FlashCol.Time=1" isn't valid.
If you provide an expression that includes a row count, that should work better for you.
For example, this expression returns true if there are rows in FlashCol where time equals exactly 1.
If(CountRows(Filter(FlashCol,Time=1)) > 0,
true,
false
)
Hi @smartin ,
Where do you want to display the icon?
I assume that you want to display the icon in a gallery.
Sine FlashCol.Time is a field, you couldn't compare it with a value directly.
I recommend you use the function of Lookup to get value from a field.
You could try this formula:
If(LookUp(FlashCol,Title=ThisItem.Title,Time)>1,true,false)
Best regards,
Community Support Team _ Phoebe Liu
Hi @smartin - can you review the above replies and update the thread if they were helpful?
Thank you,
My apologies for the delay. I've completed as requested.
User | Count |
---|---|
142 | |
142 | |
78 | |
75 | |
72 |
User | Count |
---|---|
228 | |
143 | |
78 | |
62 | |
58 |