Identifying field(s) could not be determined


#1

Hey folks,
getting this error on every POST:
“Identifying field(s) could not be determined”, also when I try to POST via the “DATA”-Manger from Dreamfactory.
Any idea?
Thank you!


#2

Janos,

Hey - appreciate you reaching out to us. Can you give me a little more detail on which POST operation(s) you were trying to perform?

Were you using default schema values when creating your data?

Anything else that you can add would be helpful - thanks!

  • Mark

#3

I am also in this situation. I created some views containing business rules. I can do the insert and select normally, but update and delete does not work.

I’m using Postgres.

CREATE TABLE banco
(
  id serial NOT NULL,
  nome character varying(60),
  CONSTRAINT banco_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);

CREATE OR REPLACE VIEW bsn_banco AS 
 SELECT b.id,
    b.nome
   FROM banco b;

#4

Fillipe, views don’t really have schema. They can return a list of available fields, but may not be able to designate what the primary (or for that matter foreign) keys are.
You will need to designate the identifying field in your API call. This is done through URL parameters. For example, you might add ?id_field=banco_pkey to the end of your URL.


#5

Thank you so much!

Solved the problem and ensured the integrity of the business rule.


#6

Hi, when I use this solution, I only get one result instead of all matching the id_field…

my_service/_table/kpi_by_installation/8?id_field=id
{
“id”: 8,
“type”: “switch_air”,
“value”: 1,
“kpi”: “1”
}

my_service/_table/kpi_by_installation
{
“resource”: [
{
“id”: 1,
“type”: “switch_air”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 1,
“type”: “switch_light”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 1,
“type”: “tamper”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 1,
“type”: “tamper”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 1,
“type”: “wifi”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 7,
“type”: “switch_air”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 7,
“type”: “switch_light”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 7,
“type”: “tamper”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 7,
“type”: “tamper”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 7,
“type”: “wifi”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 8,
“type”: “switch_air”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 8,
“type”: “switch_air”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 8,
“type”: “switch_light”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 8,
“type”: “switch_light”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 8,
“type”: “tamper”,
“value”: 1,
“kpi”: “1”
},
{
“id”: 8,
“type”: “tamper”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 8,
“type”: “wifi”,
“value”: 0,
“kpi”: “1”
},
{
“id”: 8,
“type”: “wifi”,
“value”: 1,
“kpi”: “1”
}
]
}