Forum Documentation Showcase Pricing Learn more

Composite field: What is it and how to use it

I read about the composite field in the reference and tried using it as an approach when doing an import where I tried bringing the case.csv into the “Attorney.Case” field. (So all the attorney cases would be linked as a list of elements in the Attorney table)

Another field appears which – I would guess – is a way to match the data.

No matter what I click here, another field appears which only displays “;” and “|”. What is that for?

How to use the composite field properly?

Thanks

That is the delimiter when you are uploading data into a list rather than a single field.

List delimiter
This is the delimiter you use when a field is a list of things. It should be different from the main delimiter, and the data should be in the form [xx;yy].

So in your case you could load 12-101;12-102;12-103 cases onto the Attorney.

Each would load into the Cases list for the Attorney (which I assume is a list of cases) and match with the cases on the Case table.

So you need to tell the upload (if I am understanding this correctly) that the field 12-101 is the identifier of the case on the Case table so it can find it.

I may well have this the wrong way round, but it does look like you want to tell the upload to match with the CaseId on Case ?

Thanks @NigelG, that is what I figured wile thinking about it last night… ;o)

But the implementation still escapes me. It seems impractical to have each of the cases the attorney have separated by comma. How would I do that? each case record is a line in the csv file. An attorney could have hundreds of cases in years of work.

I have a table of attorneys – geez, everyone in the forum probably know about this now! ;o)
in it I have a field “Cases” of Type “Case” which points to a list of elements in the Case table.

In other words: each attorney can have many cases.

Looking into the reference it is confusing. It says that as an example, you have a list of apartments (just like I have a list of cases) and you have a field which is the owner (my AttorneyID in the cases table)

So it seems to say that I should pick the AttorneyID as my composite field. But I am importing the cases information and trying to match the AttorneyID in the case table? That makes no sense. It should be trying to match the AttorneyId from the imported case.csv with the AttorneyID in the Attorney table.

If I do the other way around: First import all the cases, then import the Attorney information and match the AttorneyID with the Cases, the reference says it will give an error:

“If two entries in your Bubble app database match the same value, an error will be returned.”

Since the AttorneyID will appear for multiple cases already in the database, an error will be returned.

It does seem that it should be, import the Attorney data first, then import the cases. But how do I tell the Attorney database that this case I am importing is part of his list?

I found the answer to my import problem, but I am going to post in the other discussion since I was confusing Composite field usage with linking the tables. I get it now @NigelG. Thanks for the help.