Contains equivalent?

I would do the below to filter and auto populate relations in Coda:

Is there an equivalent in Fibery?

1 Like

There are auto-relations, but they don’t work with ‘contains’, only with ‘equals’.
There is a workaround that uses formulas and automations, but it’s not very pretty :confused:

2 Likes

Would you have an example somewhere of the workaround @Chr1sG ?

I have a lookup of a many to many field that results in a collection of “teams” and I want to be able to say, if it “teams” collection contains/has any of “team A”, then do this. If it contains/has any of “team B” then do that.

What do you mean by

and

?

The original enquiry was about a formula field as far as I understood. Are you looking to automate something?

I’m ultimately looking to automate putting a task on a sprint for each team.

If user from Team A is assigned to a task, add task to Team A Sprint. If user from Team B is assigned to a task, link task to Team B sprint. If user(s) from Team A and Team B are assigned to a task, link the same task to both Team A and Team B’s sprints.

I just need a field that is exposed in the automation rules that will let me do this. I can’t seem to use the “Team” field I have because it’s a collection of teams and Fibery doesn’t give me an option to listen to when that field changes. I was hoping there’s a way to use a formula that read all the values in a collection and if it “contains” a specific team, I can do the sprint linking I want.

If there’s a better way to do this instead of formulas, I’d love to hear it! I might be trying to go about this all wrong.

Are you aware that automations can be triggered for collection field changes by using the ‘Entity linked to …’ (or unlinked) option?
And you can refer to the item that was linked in any formula used in the automation action(s).

Yeah, I’ve used that before but I don’t think it helps me here. I think my use case is more complicated because I’m not trying to just link the task to a sprint, but actually link whole release (that is linked to the task) to a sprint.

I want to use a rule like this:

When: [User] is linked to a [Release]'s [Task]
Filter: [User]'s [Team] = “Team A”

Then: Link [Step 1 Release] to [Sprint]
Filter: [Step 1 Release].Date = [Sprint].Date
AND
[Step 1 Release]'s [Task]'s [Team] = [Sprint]'s [Team]

But I’m running into many, many roadblocks, likely due to how all these things are linked to each other.

The biggest issue seems to be that because 2 users (with potentially different teams) can be linked to a single task, the “Team” field is a collection and I can’t figure out how to extract only 1 value from a collection. If I could say “if collection contains “Team A”” i could likely get it to work, which is why I posted in this thread about the contains equivalent.

Can you give exact details on how all the dbs mentioned are related (1:1 or 1:n or n:n)
Release, Task, Sprint, Team, User

Thanks Chris, I think this covers it:

User (n:n) Task
User (n:1) Team

Team (1:n) Sprint
Team (n:n) Release

Release (1:n) Task
Release (n:1) Sprint

Really appreciate your help!

In one of your messages, you wrote that you wanted to automate that

but in a subsequent message, you indicated that you want to achieve

Both sound like they should be triggered by a person being assigned to a task, but in terms of actions, in the former, you are looking to link a task to a sprint, yet in the latter, you are looking to link a release to a sprint.
Which is it?

Hey Chris, sorry for the confusion, I was trying not to have to get too in the weeds on things so I oversimplified the situation initially.

The hierarchy of the sprint view I use has tasks in the level underneath releases, so the tasks are essentially “in the sprint” as long as the release is.

I’d like the release to get linked to the appropriate sprint based of the date range that matches in both (this is easy with auto association) and team of the user who is assigned to a task In the release (this is the not easy part).

Based on your post, here’s how I see the relations:

Team → Sprint → Release → Task
Release ↔ Team → User ↔ Task

So if a User from Team A is linked to a Task, you want the Release to link to Team A’s current Sprint, right? But what if a User from Team B is now linked to the Task?
According to your relations, only one Sprint can be linked to a Release, so should it be Team A’s current Sprint, or Team B’s?

Hey @Chr1sG, your question helped me figure this out!

The problem was that I was using a 1 “sprint” to many “releases” relationship when it needed to be a many to many.

Once I changed that, I could then link the sprint properly. Until then, I was only getting the “Update Sprint” option in rules.

Here’s the logic I’m using in the rule to select the right sprint:

Sprints.Filter(
Period = [Step 1 Release].Period and
[Team A] = [Step 1 Release].[Team A]
)

Also, for the above to work I had to create a series of lookups and formulas to create checkboxes on the “sprint” and “release” that flag which team the entity is associated to, which feels pretty clunky but it does the job. The checkbox logic was as follows:

If(Team.Filter(Name = "Team A").Count() = 1, true, false)

I think a “contains” operator in formulas or a way to do auto-relations with “OR” so there could be multiple ways to match things would still be very helpful, but at least it’s working now.

Thanks again for your help, sorry it took so long for things to click for me. :slight_smile:

Happy to hear you figured it out.
I don’t know what your final solution looks like, but i would have imagined that you could have an automation that triggers on a linked entity in a lookup field (which gets the Tasks’ Users) in the Release db, and then utilise the [Step 1 linked Task] in a formula to derive the appropriate Sprint.