Hello,
I'm trying to create a relationship between two records in Appian. In the database, I have already defined the primary keys, foreign keys, and constraints correctly.
However, when I go to the record type view to create the relationship and select the field from the table that contains the foreign key, I’m unable to select any field from the related record. The primary key field does not appear as an available option.
Could you please advise on what might be causing this issue?
Thank you.
Discussion posts and replies are publicly visible
Did you modify the DB after creating the records? If yes, did you adjust the fields in the record?
Hi,
Can you validate
- If both the record types are synced records?
- You mentioned you defined PK, FK in DB, it is also important to configure same in these record types. Check if it is done
- Check if the field that you are about to join are of same data type
The process I followed was: first, I created the SQL script and executed it. Then, I created the record types from the tables. After that, I tried to create the relationships, but it didn’t work.
I have checked the three options you mentioned, and everything seems to be configured correctly on my end.
At this point, I’m not seeing any issues with the primary keys, foreign keys, or the record type configuration. Please let me know if there is anything else I should review.
What kind of relation do you aim for?
Is this a 1:many relationship or many:1 relationship? Depending on which of your records you start on, this would be inverted and thus your FK field wouldn't show up where you expect it to.
Aside from that, we would probably need more information about your records (via screenshots of the relationship screen) to help.
As a side note, Appian records do not need a formal database foreign key in order to create a relationship between two sync'ed record types. We can infer that FK's are not necessary because the data fabric is designed to stitch data together across many databases, where one database has no schema information about the others and therefore no FK can exist at the database level. It is a GOOD practice to keep FK's and record relationships in sync with each other where possible, but not a functional requirement of sync'ed records.