LINKTOFILTEREDVIEW Help

Hello all,

I’m having some trouble writing this expression. Here’s what I need:

I have an action button inside the view ANIMAL_DETAIL.
Lets suppose I’m seeing the details of a female dog named “Annie”

Every animal has its father and mother (references to the same table - to another animals). So, in this view, Im gonna show all animal’s “kids”. (in the example, all annie’s kids)

So, I want the linktofilteredview to go to the “Kids” view (that’s working), and to compare the Animal’s name from previous view (ANIMAL_DETAIL) to all data in the google sheets.
If the animal in the previous view (animal_detail) is a female animal, to find all animals that have their mother named the name in the previous view (annie).
If it’s a male, all the animals whose fathers have its name.

I’m having trouble because I don’t know how to get the info (annie’s name) from the previous view I was on.

I’m not sure if it’s too confusing, english is not my first language hehe… Anyway, if it’s needed, I can explain it again

Thank you all

Solved Solved
1 7 186
1 ACCEPTED SOLUTION

This can be tricky but we can use 2 Actions to solve this.

This will work according to Sex of Parent animal.
You have a child table with kids Father and Mother

Action 1:
We would use sex of parent animal as MALE.
That means this animal is always FATHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(“ViewNameOfLookuptable”,
in([Lookuptable ID],
  select(Lookuptable Name[Lookuptable ID],
  [PAI]=[_THISROW].[YOUR ROW ID]
        )
   )
)

Condition for this action would be [sex]="Male"

Same applies for Action 2 also but with a bit changes.

Action 2:
We would use sex of parent animal as FEMALE.
That means this animal is always MOTHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(“ViewNameOfLookuptable”,
in([Lookuptable ID],
        select(Lookuptable Name[Lookuptable ID],
        [Mãe]=[_THISROW].[YOUR ROW ID]
          )
    )
)

Condition for this action would be [sex]="Female"

This will switch the action according to the parent sex and lookup tables according to father and mother ID and show kids related to this Animal.

Hope this Helps.

View solution in original post

7 REPLIES 7

Try using this Function in LINKTOFILTEREDVIEW()

A combination of IN() and SELECT() Could solve your problem. If you can show me your table structure I can help you with that.

You can use below expression for your reference.

LINKTOFILTEREDVIEW("ViewNameOfLookuptable",
in([Lookuptable ID],
         select(Lookuptable Name[Lookuptable ID],
                      [Column to check]="Kids"
              )
       )
 )

Sure, here it goes (Its in portuguese, so I translated in the post)

3X_f_9_f95b41a9003006f541c107641c90d2aebecc0fea.png
Pai = father
Mãe = mother
Nome completo = complete name (its a concatenation between some names + indentifying codes)

3X_9_f_9fae4f485ce8d25ff8fc51d973c4971c61a13bf6.png

Ver Filhos = see kids
In the fields Pai and Mãe, its shown the complete name of both

Whenever clicking in the action “Ver filhos” It should open a new view with all kids from the animal shown in this view

Is it enough to you understand ? or its missing something ? in the table structure

Thank you again

Blockquote
Column to check]=“Kids”

The problem with this, I dont have a column named Kids, because one animal can have a lot of kids. The connection I have is: all animals refers to a father and a mother, but the mother and father have no connection to their kids. So I have to find their kids finding where they are put as father/mother in the sheets.

3X_0_1_0123ce6c6b8630386746baaaf12b386216ffc091.png

something like that

edit : for example:

I have to find “Annie’s kids”, so I have to search in the sheets any other animals who have Annie’s ID as their mother.

I dont have a column or a table that I could pull annie’s kids from there, I have to do a search in all mothers and find annie’s ID on it, and select those rows to show in the view

Can you show me your kids table ?

This can be tricky but we can use 2 Actions to solve this.

This will work according to Sex of Parent animal.
You have a child table with kids Father and Mother

Action 1:
We would use sex of parent animal as MALE.
That means this animal is always FATHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(“ViewNameOfLookuptable”,
in([Lookuptable ID],
  select(Lookuptable Name[Lookuptable ID],
  [PAI]=[_THISROW].[YOUR ROW ID]
        )
   )
)

Condition for this action would be [sex]="Male"

Same applies for Action 2 also but with a bit changes.

Action 2:
We would use sex of parent animal as FEMALE.
That means this animal is always MOTHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(“ViewNameOfLookuptable”,
in([Lookuptable ID],
        select(Lookuptable Name[Lookuptable ID],
        [Mãe]=[_THISROW].[YOUR ROW ID]
          )
    )
)

Condition for this action would be [sex]="Female"

This will switch the action according to the parent sex and lookup tables according to father and mother ID and show kids related to this Animal.

Hope this Helps.

Thank you ! ❤️

Worked perfectly

Top Labels in this Space