Cell value type is JS Object. Change to Text.

Hello! I have been trying to create a Hook to update a cell value beforeUpdate of an item. I am trying to change the value by assigning the value of the “university” field to the “universityCopy” field. For some reason, I am getting an error saying that the Cell value is JS Object (maybe because I am assigning the value from a referenced field?)

Let me know if I need to provide more information. I am new to javascript, so any help is greatly appreciated!

Code:

export function Members_beforeUpdate(item, context) {

item.universityCopy = item.university; 

return item; 

}

Hi Christine,
A value of a reference field is an _id value of the item from the referenced collection.
What is your goal ?
Roi

Was trying to find a different way to accomplish the issue I was referencing in post: https://www.wix.com/code/home/forum/questions-answers/help-how-to-query-filter-data-from-referenced-collections

So if I’m able to filter off of a referenced collection, I actually probably won’t need help on creating the hook.

Thanks!

Christine