cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smartin
Level: Powered On

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
Community Support Team
Community Support Team

Re: Collection Reference for OnVisible

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
Level 8

Re: Collection Reference for OnVisible

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!

Super User
Super User

Re: Collection Reference for OnVisible

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
)
Community Support Team
Community Support Team

Re: Collection Reference for OnVisible

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

TopShelf-MSFT
Level 10

Re: Collection Reference for OnVisible

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

 

Thank you,

 

@TopShelf-MSFT 

smartin
Level: Powered On

Re: Collection Reference for OnVisible

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,715)