cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smartin
Helper II
Helper II

Collection Reference for OnVisible

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)

@Willo 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

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

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Maurits
Resolver III
Resolver III

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!

timl
Super User
Super User

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
)
v-yutliu-msft
Community Support
Community Support

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

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi @smartin - can you review the above replies and update the thread if they were helpful? 

 

Thank you,

 

@Anonymous 

My apologies for the delay. I've completed as requested. 

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,327)