I’m having trouble creating a record with DX API using a savable data page. The API call is successful only if the payload contains just the key field of the data type. If I specify any other field, the call fails with the following response:
For D_apitestdatatypeSavable, the field fieldB wasn't found in the view Create for the flow action CREATE
Fields are invalid for the data view 'D_apitestdatatypeSavable' - action 'CREATE'
Invalid request payload
I have a data type with ID MyOrg-Siqdemos-Data-ApiTestDataType, it contains two text fields, fieldA and fieldB. I generated the data pages on the Sources tab of the data type. The key of the type is fieldA. The ID of the savable data page is D_apitestdatatypeSavable.
The REST operation is POST /data/{data_view_ID} Create data record. The request body is:
From App Studio navigate to the data type → view and create view rule with name Create add fields to this view which are required for insert operation, now try to insert records it will work.
Repeat the same when you want to Update a record. View name will be pyEdit.
@SriHarsha Anika thank you for your reply, by creating Create View I am able to create the record. But for Update pega is not allowing me to create View with pyEdit, can you suggest please?
@Chiranjeevi_DupatiDX API’s work in-line with Constellation only for now. In Constellation from app studio view named pyEdit is created to handle the updates. from the screen shot it is inferred you are leveraging theme-cosmos which does not support creating a rule with prefixes of px, py,pz.
I have tried using the solution to create and it worked by using the create data view.
But for update, I have created the update data view and added the properties. It is not working. Only primary key property is working in update, any additional properties in the update request are failing.