Skip to main content
January 26, 2024
Solved

Mapping Composite Key from API to Record type

  • January 26, 2024
  • 7 replies
  • 0 views

I'm working with data via API that uses composite keys and need to store the data in Record type. However, I understand that composite keys are not supported in record types. Could anyone suggest a way to handle this situation or provide any workarounds?

Best answer by stefanhelzle0001

I do not understand why you could not concatenate a date field ?!?

I was not talking about a custom record field, but about a normal text field in the database to hold that merged key. Then this can act as PK in the DB and in the record.

7 replies

stefanhelzle0001
Brainy
January 26, 2024

Did you consider to just concatenate the key values into a single text field? Maybe in addition to the original fields which then will not be used as keys anymore.

January 26, 2024

I could not concatenate the key values since one of them has date datatype, but I tried to create a random field to have it as ID and then to leave it as primary, but we are reading data from a web service therefore we couldn't sync a record type without having initially a unique primary key, so even if I create a custom field I could not mark it as primary

stefanhelzle0001
Brainy
January 26, 2024

I do not understand why you could not concatenate a date field ?!?

I was not talking about a custom record field, but about a normal text field in the database to hold that merged key. Then this can act as PK in the DB and in the record.

mathieud0001
Brainy
January 26, 2024

Concatenated key is the only way to do it.

January 26, 2024

thanks