Deep save errors when updating an object

In an API, I am using Deep save to update an object and related objects.

Saving new records works fine, but when I try to update a record by providing a “full” object including ___class and ___jsonclass columns, I get this error:

Error: Deep save exception. Column '___jsonclass' in table 'RelCo_Assessment' does not exists. All tables and columns must be present in the database before a transaction is executed.

I thought providing Deep save with a regular object was how it was supposed to work. Do I really need to get rid of these extra columns before using Deep save, or am I doing something wrong?

This is the block that fails:

And here is one object I am trying to update, with IDs redacted:

{
    ___jsonclass: 'RelCo_Assessment',
    ___class: 'RelCo_Assessment',
    startedManager: 0,
    ownerId: 'xxx',
    completedEmployee: 0,
    completedOwnSingle: 0,
    completedOwnManager: 0,
    uniqueCode: 'cf5ca043',
    Rel_User: User{
        ___class: 'Users',
        ___jsonclass: 'Users',
        lastLogin: null,
        profileText: null,
        firstname: 'Hans',
        userStatus: 'EMAIL_CONFIRMATION_PENDING',
        created: 1689156055637,
        accountType: 'BACKENDLESS',
        profileImage: null,
        ownerId: 'xxx',
        socialAccount: 'BACKENDLESS',
        oAuthIdentities: null,
        lastname: 'Hansen',
        name: 'HansHansen',
        blUserLocale: 'no',
        numTokens: 0,
        updated: 1689160963881,
        email: 'egil+hans@egil.net',
        objectId: 'xxx'
    },
    completedManager: 0,
    sumEvaluated: 0,
    startedColleague: 0,
    numColleague: 0,
    objectId: 'xxx',
    numEmployee: 1,
    created: 1689160371832,
    completedColleague: 0,
    startedEmployee: 0,
    sumCompleted: 0,
    numManager: 6,
    allCompleted: false,
    numOwnManager: 0,
    sumAvailable: 5,
    allStarted: false,
    numOwnSingle: 1,
    startedOwnManager: 0,
    updated: null,
    startedOwnSingle: 0,
    sumStarted: 0
}

Could you please clarify where you get the user, assessment and instructor objects from? Please show the blocks you retrieve these objects with.

Sure.

assessment object is the main object, related to both user (Rel_User) and instructor (Rel_Instructor) in the table schema. The object is coming from a form in UI Builder, and the json posted is the output that form into the API function.

user object is the related user object, provided only for create operations.

instructor object is the other related object, created from getting the user info of the logged in user.

FWIW, this has for now fixed the problem for me…:

The error is gone because you removed the properties with the underscores.
However, could you please show the logic where you retrieve the objects with the underscores?

Not sure what you mean Olha, so forgive me if I am off target.

This is called as an API method:

The entrypoint for the function shown above gets its input directly from the method arguments:

They payload you have already seen above.

Not sure what else you are after, so please guide me as needed!

Hi @Egil_Helland,

we are interested in how these fields (___jsonClass) got into your object, that’s why Olha is asking you to show how you composed/retrieved this object so we could point out the root problem.

On your last screenshot, I see that assessment is a method argument, so there should be some place where you invoke this method and pass the assessment object. We’re trying to find out where ___jsonClass was added to your object.

Regards,
Stanislaw

Well, yes, it is invoked by calling the API service, is that what you mean?

The form gets its selection/data from here:

CleanShot 2023-07-13 at 14.01.24@2x

Which is a row from a container with this content:

That loadDataWithPaging function is just there to handle paging.

This an example row with Rel_User set in the Repeater Data block (without the ___jsonClass):

This is a print just before calling the API method (no ___jsonClass):

{
	"firstname": "Hans",
	"Rel_Instructor": {
		"profileText": "En kort beskrivelse om hvem jeg er osv...",
		"lastLogin": 1689249832000,
		"firstname": "Egil",
		"userStatus": "ENABLED",
		"created": 1675174678975,
		"accountType": "BACKENDLESS",
		"profileImage": "xxx",
		"ownerId": "xxx",
		"socialAccount": "BACKENDLESS",
		"oAuthIdentities": null,
		"lastname": "Helland",
		"___class": "Users",
		"name": "Egil Helland",
		"blUserLocale": "no",
		"updated": 1689250913767,
		"numTokens": 132,
		"email": "xxx",
		"objectId": "xxx"
	},
	"startedManager": 0,
	"ownerId": "xxx",
	"completedEmployee": 0,
	"completedOwnSingle": 0,
	"completedOwnManager": 0,
	"uniqueCode": "59b577ce",
	"Rel_User": {
		"profileText": null,
		"lastLogin": null,
		"firstname": "Hans",
		"userStatus": "EMAIL_CONFIRMATION_PENDING",
		"created": 1689156055637,
		"accountType": "BACKENDLESS",
		"profileImage": null,
		"ownerId": "xxx",
		"socialAccount": "BACKENDLESS",
		"oAuthIdentities": null,
		"lastname": "Hansen",
		"___class": "Users",
		"name": "Hans Hansen",
		"blUserLocale": "no",
		"updated": 1689250913167,
		"numTokens": 0,
		"email": "xxx",
		"objectId": "xxx"
	},
	"___class": "RelCo_Assessment",
	"completedManager": 0,
	"sumEvaluated": 0,
	"startedColleague": 0,
	"numColleague": 2,
	"objectId": "xxx",
	"email": "xxx",
	"numEmployee": 4,
	"created": 1689160881562,
	"completedColleague": 0,
	"startedEmployee": 0,
	"sumCompleted": 0,
	"lastname": "Hansen",
	"numManager": 2,
	"allCompleted": false,
	"numOwnManager": 1,
	"sumAvailable": 9,
	"allStarted": false,
	"name": "Hans Hansen",
	"numOwnSingle": 0,
	"startedOwnManager": 0,
	"updated": 1689250913104,
	"startedOwnSingle": 0,
	"sumStarted": 0
}

Emails and IDs redacted only.
And here is what came in on the API side:

14:21:52.830|SERVER_CODE|INFO|[630718]
{
    ___jsonclass: 'RelCo_Assessment',
    ___class: 'RelCo_Assessment',
    firstname: 'Hans',
    Rel_Instructor: User{
        ___class: 'Users',
        ___jsonclass: 'Users',
        lastLogin: 1689249832000,
        profileText: 'Enkortbeskrivelseomhvemjegerosv...',
        firstname: 'Egil',
        userStatus: 'ENABLED',
        created: 1675174678975,
        accountType: 'BACKENDLESS',
        profileImage: 'xxx',
        ownerId: 'xxx',
        socialAccount: 'BACKENDLESS',
        oAuthIdentities: null,
        lastname: 'Helland',
        name: 'EgilHelland',
        blUserLocale: 'no',
        numTokens: 133,
        updated: 1689237746871,
        email: 'xxx',
        objectId: 'xxx'
    },
    startedManager: 0,
    ownerId: 'xxx',
    completedEmployee: 0,
    completedOwnSingle: 0,
    completedOwnManager: 0,
    uniqueCode: '59b577ce',
    Rel_User: User{
        ___class: 'Users',
        ___jsonclass: 'Users',
        lastLogin: null,
        profileText: null,
        firstname: 'Hans',
        userStatus: 'EMAIL_CONFIRMATION_PENDING',
        created: 1689156055637,
        accountType: 'BACKENDLESS',
        profileImage: null,
        ownerId: 'xxx',
        socialAccount: 'BACKENDLESS',
        oAuthIdentities: null,
        lastname: 'Hansen',
        name: 'HansHansen',
        blUserLocale: 'no',
        numTokens: 0,
        updated: 1689237696221,
        email: 'xxx',
        objectId: 'xxx'
    },
    completedManager: 0,
    sumEvaluated: 0,
    startedColleague: 0,
    numColleague: 2,
    objectId: 'xxx',
    email: 'xxx',
    numEmployee: 4,
    created: 1689160881562,
    completedColleague: 0,
    startedEmployee: 0,
    sumCompleted: 0,
    lastname: 'Hansen',
    numManager: 2,
    allCompleted: false,
    numOwnManager: 1,
    sumAvailable: 8,
    allStarted: false,
    name: 'HansHansen',
    numOwnSingle: 0,
    startedOwnManager: 0,
    updated: 1689237696161,
    startedOwnSingle: 0,
    sumStarted: 0
}

Hope that was helpful.

Thank you. This is helpful.

For now, the only way to avoid this issue is to manually remove ___jsonClass property.
We will think if we can improve this on our side.

Hello @Egil_Helland

We’ve just updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?

Regards,
Inna