dynamic class if object in object list then ...

0
I am trying to create a dynamic way of adding visitors to a visit, and with this I am wanting to create a dynamic row class in a Data Grid 2, the row would highlight if it has been added to a visit.   My first method was (paraphrasing here) "if $Visitor/visit != empty then differentBg" This would work however I then noticed that if I was to create a new event the rows would still be highlighted as the exisiting connection is there   I then tried "if visitor/visit = visit" then differentBg" however it told me cannot compare list of visit to object of visit.   I then looked into contains but this only works with strings.   Is there a way to check if an object exists in a list of objects in an expression? (I know this can be done in a microflow but does not allow for a microflow here)   Many thanks
asked
2 answers
0

Here's an image of my domain model, it's a bit messy but its basically:

Visitors - this is a list of every visitor, this what will be used t oselect the visitors

Visitor - this is a list of a visitors data for a visit for stuff like checking in and status of them being approved

Visit - this is a visit that stores data about the visit

A visit can have multiple visitors (Visitor)

A visitor (Visitors) can have multiple visits

 

 

image.png

answered
0

image.png

 

image.png

 

image.png

 

 

yeh so you add visitors by creating the "Visitor" entity, this allows visitors to have multiple visit. first screenshot is the datagrid where you select visitors, second screenshot is the miccroflow that is called when you add a visitor - it basically creates the visitor entity if you are adding or deletes it if you are removing. Final screenshot is the expression for changing the view of an entity

answered