I'm currently trying to query a listing to get all the children that have a certain property entered. The property is a select property with 4 different values.
So far I've managed to check if the item has a property value by adding:
.Where(x => x.HasValue("sessionDay"));
Now I want to check if that value equals "Day 1 AM" or "Day 1 PM" for example, two of the select options.
Can anyone help me with what to add to the above code to add a line to the query to only get children with the property value "Day 1 AM"?
Or the better alternative might be to change the for each statement, var item in selection where sessionDay = Day 1 AM? Not quite sure how to write that?
Query list by select property
Hello,
I'm currently trying to query a listing to get all the children that have a certain property entered. The property is a select property with 4 different values.
So far I've managed to check if the item has a property value by adding:
Now I want to check if that value equals "Day 1 AM" or "Day 1 PM" for example, two of the select options.
Can anyone help me with what to add to the above code to add a line to the query to only get children with the property value "Day 1 AM"?
Or the better alternative might be to change the for each statement, var item in selection where sessionDay = Day 1 AM? Not quite sure how to write that?
Thanks in advance for any help
You should be able to just use a where clause like below
where(x=>X.Value("sessionDate")=="Day 1 AM")
Sorry misread your question so ignore my answer, although you could possibly advit to your for each to just show them based on the name of your item
is working on a reply...