Does this value display in repeating group... if not, flag it

The box in grey is a repeating group displaying a top category (phases) and below that visits that are nested into any one or multiple of these phases.

The box below that lists out all the visits entered by the user that are in the database. There could be visits that are not ‘allocated’ a phase. For example, MRI scan does not appear in any of the phases above.

I’m trying to workout a suitable conditional expression that will highlight the unallocated text with ‘unallocated’ for the visits in the second box have not been allocated to a phase. So then the user can clearly see from the list which they need to allocate. I’ve tried a few but they always seem to fail my tests of being flagged when they shouldn’t be.

I should also add that the phases belong to another datatype but they are linked through a mutual field between the tables.

I think for each cell in the second repeating group, the condition should be simply Do a search for 'Phase' with constraint 'Visits' doesn't contain Current Cell's Visit : count is 0. This will return yes for MRI Scan and 6-month follow-up according to the data above.
Of course, this assumes there is a Phase data type and Phase has a list of Visits.

1 Like

I can see what you’re going for but the outcome on the front end provides me with the entire list.

I don’t haveCurrent cell's visit, only Parent group...

I tried something else that logically to me should’ve worked I think.

In the RG, there is a Search for Phase anyway to pull that data you already see in that second RG, I created a constraint in this search:

Name of Visits doesn't contain Search for Phases :each item's Name of Phases there is no added constraint in this second search function, the filtering should be done in this initial searching.

So in my head I see it as a search is being done to pull up all the data in the Visits datatype, and then there is a constraint which initiates another search which checks if the Phase name that the user selected matches with the name in the Phases datatype.

Strangely, it still provides me with the entire list. By the way this isn’t a conditional statement, it’s being done in the data source field in the RG.

In the original post, you said:

That’s why as far as I understand, the second one will show all visits. But the ones that do not belong to any Phases in the above, should have some text or some indicator to represent unallocated. I gave you the conditional for this kind of unallocated indicator.

If you want to just display the unallocated visits in the second repeating group, you can simply do Do a search for Visits:filtered by advanced (Do a Search for Phases: Visits contain this visit):count is 0. I think this should just show unallocated visits as repeating group data source.

I went back to the conditional set up as prefer this and played around with it. Here it is working now:

Screenshot 2024-02-05 at 13.47.28

But I don’t get the :count is 0 part of the syntax?

I have also discovered something interesting happen. I changed all the names for the Phases(A, B, C) datatype, but in the RG where I created this condition, I was expecting all of the Visits to now return as Not allocated, but it hasn’t

The Visits datatype still ha Phase 1, 2, 3 saved in the table, but because the condition checks the Phase datatype name (which has now changed) against what’s saved in the Visit datatype, shouldn’t there be a flagging of this based on the syntax?

For sake of recording solution for forum, I have seemed to fix this by changing the syntax from doesn't contain to contains keywords which now knocks out any other Visits that were allocated to a Phase that laster becomes changed. This forces users to then go back and re-allocate the Visits correctly.

This topic was automatically closed after 70 days. New replies are no longer allowed.