cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vidanaw
Helper IV
Helper IV

How to chcek collection filed value

Hi All,

I have a collection wich load with SharePoint data source. In the collection I have a field called Status (mapped with SharePoint choose column type), now I want to check is this value is equal to "Open".

FYI- this collection have only one item at any given time.

 

I need something like if( Collection.Status = Open, UpdateContext({btndisplay:false}), UpdateContext({btndisplay:true}))

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

If the collection will only ever have one record then you can check this way.

if( First(Collection).Status.Value = "Open", UpdateContext({btndisplay:false}), UpdateContext({btndisplay:true}))

Using First() will get the first record.  Then you can check the Status field of that record.  Since its a choice field you will need to use the specific name of the property of the field that holds the value Open.  This is usually Value, but can be other things.



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

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@Vidanaw
The solution is to change your collection reference into a record using the FIRST function. Fortunately this will not take much time to do.

if(First(Collection).Status = ”Open”, UpdateContext({btndisplay:false}), UpdateContext({btndisplay:true}))

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
Pstork1
Dual Super User III
Dual Super User III

If the collection will only ever have one record then you can check this way.

if( First(Collection).Status.Value = "Open", UpdateContext({btndisplay:false}), UpdateContext({btndisplay:true}))

Using First() will get the first record.  Then you can check the Status field of that record.  Since its a choice field you will need to use the specific name of the property of the field that holds the value Open.  This is usually Value, but can be other things.



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

View solution in original post

Thank you very much, really appreciate the assistance.

Thanks.

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 (2,519)