Deep save exception. Property 'password' is required

I am getting this error when trying to Deep Save a new row with a relationship to a list of users.

  1. Get the Users -
    image

  2. Deep save a row and add the relationship to Fundraiser and Users

I’ve tried passing userList without the map function, that didn’t work either -

This is the schema -

What am I missing?

Thanks,
Tim

Try removing this - the password property is never returned from the database.

If this does not help, see if removing the Users property in the object you save in Deep Save (as a debugging step) to see if it makes any difference.

Thanks for jumping in @mark-piller!

I removed the password property, no change to the behavior.

I removed the Users property from the deep save object -

The row was inserted without the Users relationship -

Could you print userList and check what is inside?

I’ve tried to reproduce your issue, but everything works fine. So I assume the problem is in the logic.

You’re right; there is an issue with the logic. But I’m confused about what is happening. I made a test bit of code to demonstrate the problem -

The return of userList contains -

[
{
“___class”: “Users”,
“email”: “ASHLEY@meadowfarms.com”,
“objectId”: “B83BE765-FA8A-4A16-B200-9A2E8805329D”
},
{
“email”: “tim@meadowfarms.com
}
]

My email was added to sendToList, not userList, but userList has been updated. Why is that happening?

Thanks,
Tim

That is how JS works(Codeless built on it)

image

Here you do not copy the object, but link them.

If you want to copy use Convert to Text + Convert to Object block, and the result will not be linked.

Oh, interesting. Good to know, I’ve never worked in a language that is like that and this hasn’t come up before. So, the variable is a passed reference, not the actual value. What is the technical term for this?

When you modify a value and assign that to another variable, does that create a modified copy of the values? Or more correctly a new reference to the changed value?

Thanks for your help,
Tim

Hello @Tim_Jones

What is the technical term for this?

Primitive Types and Reference Types in JavaScript

When you modify a value and assign that to another variable, does that create a modified copy of the values? Or more correctly a new reference to the changed value?

Depends on the data type. If it’s a primitive (example: number, boolean, string) then copy. If it’s a reference (example: object, array) then by reference.

Regards

Can you explain what happens here -

sendToList should not be linked to userList, right?

@Tim_Jones

“Map items” block creates a new array (sendToList) and does not modify (userList).
But for example:


“newList” does not equal to “originList”, but “someObject” is the same to any of the “newList” children.

Thanks for the example @viktor.liablin.

If, after setting newList, I were to change someObject, propName from 123 to 1234, would that change all newList’s children to 1234?

Tim

Hello @Tim_Jones!

Yes, you’ve got it right – the value of propName will be 1234.

Regards,
Alexander

Thanks! I appreciate that you’ve taken the time to explain this to me.

Best,
Tim