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! Go to 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.
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)
Pai = father
Mรฃe = mother
Nome completo = complete name (its a concatenation between some names + indentifying codes)
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.
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
User | Count |
---|---|
39 | |
35 | |
29 | |
23 | |
18 |