Assigning ownership of a thing of a custom data type to another thing

Hi all,

I have a thing of data type “Child” which is created after a user submits some basic info about the child, for example First Name.

The Child should belong to a User. Currently, I have a field under data type Child called User which tells the Child who they belong to.

Under User, I have a data type Child. What I am trying to do is now add the Child that has been created to the User.

This would allow me to access the User’s Child’s information much more easily, e.g. by now displaying “Current User’s Child’s First Name”. Instead, I am jumping through hoops to say: “Do a search for Child where Child’s user = Current user”.

Is it possible to do what I am trying to do? It seems like it might be trivial but I haven’t figured it out, and doing a ton of searches through all the Child that exist seems like it might cause performance issues.

I have tried to Make changes to user… change field Child, add the Child that was just created, but get this error message. I also tried to Make changes to user… and create the child directly there instead of first creating a separate Child, but couldn’t figure out how to go about that.

Thanks for your help.

Ken

Yes, this is possible, your thinking process is correct and it is the right way to achieve what you want. I’ve never seen that particular error message though. Maybe another forum member will shed insight on that. Could be something obvious that I don’t see or a bug.

Just verifying the terms you used to describe the situation: under User, if you have a field named “child”, its field type is “Child”, and This field is a list is checked, then the workflow you show should work as is.

Thanks for the response. You are correct here: “Just verifying the terms you used to describe the situation: under User, if you have a field named “child”, its field type is “Child”, and This field is a list is checked, then the workflow you show should work as is.”

Perhaps someone else can shed light on the error message, “value should be Child but right now it is a different Child”

Thanks

Only other suggestion I have is to test for a bug. I would add a new field under User with a different name, say “Children” or “ChildTest” or “whatever”, make its data type “Child”, and check the list option. (essentially dupicating your existing “child” field that is already under User–you can just leave that original one alone for this test). Now use the new field in your “make changes to User” workflow and see if you get the same error message.

My suspicion is that if you have been “editing/adding/deleting/reusing same name” of the existing “child” field that perhaps Bubble is erroneously seeing some sort of type mismatch (which should not happen). This is just an educated guess, based on prior issues with renaming/reusing/modifying data fields types and names. Worth a try just to eliminate that possibility.

Thank you Meyer! You are exactly right – looks like it was a bug because I had been editing/adding/deleting things called child. I created a new field and now it’s working.

Appreciate the help.

Ken

Glad you got it!

I couldn’t locate this when you asked, but I think this function ‘may’ prevent that problem–permanently delete old/unused/deleted data types:

Data tab/Copy and Restore Database (in red, top right):

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.