I am curious as to why I cannot use a collection in an if formula.
Example. In 1 database, I have 3 fields.
If field 1 is set and field 2 is empty, then field 3 is set with entities that meet the criteria
If field 1 and 2 are set, then field 3 is set with entities that meet the criteria
If field 1 and 2 are empty, then field 3 should also be empty.
But the response I get is that I cannot use a collection in an if formula. I would like to understand why this is not possible. And if there is no logical explanation and if this should be developmentally possible, I would be very happy. Now I need 3 automations where otherwise I could have 1.
Mmm I kinda believe that the automations we have are a bit to complex to combine. But curious (and stubborn) enough to give
Automation 1 → Update all periodes and planning if ‘Date range’ is updated.
Clear planning
Formula for ‘all periodes’ is
Periodes.Filter(
[Step 1 Doelen].Looptijd.Start() <= [End date] and
[Step 1 Doelen].Looptijd.End() >= [Start date] and
(Type.Name = “Maand” or Type.Name = “Kwartaal” or Type.Name = “Jaar”)
)
Automation 2 → Update date range and all periods if ‘planning’ is updated
Clear date range
Formula for ‘all periodes’ is
Periodes.Filter(
Least(
[Step 1 Doelen].Looptijd.Start(),
[Step 1 Doelen].Planning.[Start date]
) <= [End date] and
Greatest(
[Step 1 Doelen].Looptijd.End(),
[Step 1 Doelen].Planning.[End date]
) >= [Start date] and
If(
[Step 1 Doelen].Planning.Type.Name = “Jaar”,
Type.Name = “Jaar”,
If(
[Step 1 Doelen].Planning.Type.Name = “Kwartaal”,
Type.Name = “Jaar” or Type.Name = “Kwartaal”,
Type.Name = “Jaar” or Type.Name = “Kwartaal” or Type.Name = “Maand”
) ) )
Automation 3 → Empty ‘all periods’
Empty ‘All periods’ when date range is empty AND planning is empty.
So it’s a bit complexer than the solution you have given. I believe it should be possible with your workaround, but can’t see how.
meant ‘If field 1 is not empty and field 2 is empty’ rather than ‘If field 1 is updated and field 2 is empty’
I don’t think it’s possible to combine the automations into a single one since there is no way for a formula to know which field was updated to trigger the automation.