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

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
Dual Super User
Dual Super User

Re: How to chcek collection filed value

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
Super User
Super User

Re: How to chcek collection filed value

@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.
Dual Super User
Dual Super User

Re: How to chcek collection filed value

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

Vidanaw
Level: Powered On

Re: How to chcek collection filed value

Thank you very much, really appreciate the assistance.

Thanks.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,256)