How to use an item from a roster in an enabling condition

Dear All

How can I use a question Which is a question from a roster in an enabling condition for a new section. For example the number of rows in a roster is decided by the number of trips a person takes and the question “Have you stayed overnight” is used to enable a new section is if the answer to this question from any trips (if more than 1) within the roster is yes then the section should be enabled.

Thank you in advance

My understanding is that you want to enable a section if there is at least one “yes” answer to a question in a roster. If so, what you, here’s an answer in pseudo-code:

tripsRoster.Any(x => x.stayedOvernight == 1)

To unpack the code above:

  • tripsRoster is the name of your roster
  • Any is query method
  • This expression provides the terms of the query: x => x.stayedOvernight == 1
  • The expression is an anonymous function, of lambda function, that can be read as: an observation such that stayedOveright is “yes”

For more details, please have a look at the LINQ article. For further example, beyond those in the articles and some public questionnaires, search for some answered questions on this forum.

1 Like