"is a part of" 2 tables - HELP

Hi everyone I have to solve an issue which I am having trouble to and I would like to see if any of you can help me sort this out…

I have a table “Familias” (families) which have a Ref Table “Elementos da Familia” (family members) which is a part of “Familias”

I then have another table called “Diligencias” (Diligence of services) that must refer for each family.
Nonetheless I need to relate to one or more “Elementos da Familia” (family members). As this table is already “a part of” the table “Familias” (Family) how can I include several family members to the diligence row?

any ideas?

“A table can only have one Ref column marked IsAPartOf (a row can only be a part of one other row).”

1 Like

Thanx, I now this and how it works.
how does your post help solve my issue? did you read all my post?

In the relationship between “Diligencias” and “Elementos da Familia” you would NOT use the “Is part of” property.

Instead your column in the “Diligencias” table would need to be defined as EnumList with a base type of “Ref” and the source table set as “Elementos da Familia”. This will allow you add one or more family members to a “Diligencias” row.

NOTE: In an EnumList/Ref (also Enum/Ref) type column, in order to set the source table you MUST first save the column changes once you have set EnumList and base type as Ref. It’s an annoying bug where the source table property will not show until after an initial save.

1 Like

It doesn’t. I was just pointing out that it’s not possible to have more than one column in a table set to ‘Is Part Of’. I was trying to save you the trouble of attempting the impossible. :slight_smile:

I think @WillowMobileSystems suggestion should work.

2 Likes

This is something new, and I will definitely try this out!!!

I will let you know how it goes!!

1 Like

Thanx anyway man!!!

1 Like

John,

I tried doing exactly what you mentioned, at the beginning it seemed to work as for a minute I could list the elements inside the “Elementos da Familia” using the methodology you mentioned.

now I dont seem to be able to get it up and running again… I’ve tried several times even set up new tables and new app from scratch and it doesn’t work… if some kind of bug is preventing this to list.

here are screenshots of the test app I created from scratch




Any thoughts?

For the “ID Elemento Familia” in the “Diligencias” table, you need to tell it what values to show in the dropdown so you’ll need to add to an expression to the Valid_If or Suggested Values properties.

If you want to be able to simply select values and not add new ones, place the below expression in the “Valid_If” property. To be able to add new entries from the the dropdown list, you’ll want to insert the expression in the “Suggested Values” property. In both cases the expression is the same.

SELECT(Elementos da Familia[ID Elemento Familia], true)
2 Likes

Or just:

Elementos da Familia[ID Elemento Familia]

without SELECT().

3 Likes

@Luis_Gomes_Machado FYI, I understand part of your confusion with the dropdown being blank. I didn’t mention the below before because I was a little uncertain. But I just encountered a similar situation.

There are times when a column dropdown will automatically populate without the need of an explicit expression. Under other circumstances an expression is required to populate the desired dropdown values.

I have never investigated to understand when these two situations are expected. I have opened another post to get some clarity about this.

1 Like

Thanx both Steve and John!

I was finally able to list them!
Nonetheless I encountered a problem.

any idea why the “Dangerous” signs on the options?

2 Likes

Yes, you most likely changed the SELECT() to return the “Nome” column instead of the ID/Key column? REplace the “Nome” column with the ID column and you’ll be good.

REF columns MUST use the key column of the table they are referencing. This is how the link, or reference, is created that allows you access the other columns from the referenced table.

For dropdown display names, Ref columns will automatically use the Label column. In your case the Label column is already set to “Nome” so it will automatically display that value in the dropdown for you in place of the ID value. In the data, the ID value will be stored.

1 Like

I Tried both your methods and the select method does not allow me to do a dependent dropdown that I need in this case, so I went with Steve’s method

Elementos da Familia[ID Elemento Familia]

The problem is that is listing the “ID Elemento da Familia” code and not “Apelido” which is the practical column for the user.
So I went back to the Familia table and set the KEY to “Apelido” which is not optimal as it is not an UNIQUEID(), as:

Elementos da Familia[Apelido]

This way it brings the “Apelido” which is what I need to show.
If I go back to set the KEY to [ID Elemento Familia], how can I display the name instead of the actual code?
and how can I get rid of the “Dangerous” signs?

I Tried both your methods and the select method does not allow me to do a dependent dropdown that I need in this case, so I went with Steve’s method

Elementos da Familia[ID Elemento Familia]

The problem is that is listing the “ID Elemento da Familia” code and not “Apelido” which is the practical column for the user.
So I went back to the Familia table and set the KEY to “Apelido” which is not optimal as it is not an UNIQUEID(), as:

Elementos da Familia[Apelido]

This way it brings the “Apelido” which is what I need to show.
If I go back to set the KEY to [ID Elemento Familia], how can I display the name instead of the actual code?
and how can I get rid of the “Dangerous” signs?

there is probably no “andres” as a key value in your table, it can’t ref to that string value

Did you use a dropdown or buttons?

Thanx for your reply.

“andres” is the row of a column [Name] which has an [ID Elemento Familia] which is KEY

it’s set to AUTO

Hey @Luis_Gomes_Machado I hope you’re doing well my friend!