Can't Create Tasks without personId / opportunityId
I am currently trying to migrate my tasks and create task targets with the API. Unfortunately, some tasks just don't have a personId or opportunityId assigned to them. When I null these values in the API, I get errors ("invalid input syntax for type uuid"). What can I do to avoid that error?
22 Replies
Hey is it also occurring when not sending anything a those fields ? REST api or graphQl one ?
Or you might be able to send empty strings
Empty strings cause the same error. Actually need to remove those lines from the JSON, then it works. Using REST API.
Sending null means you want to erase current value, though these are not nullable makes sense for the empty tring too
Might(!) make sense for a PATCH call, but when initially creating the targets?
You can create a task that has no relation
Yeah, just took me a workaround. I would have expected to be able to send null values. Now I actively have to filter those out. Also: What happens if I remove a relation from a task? Isn't that the same as nulling it's value?
Mhm indeed you're right, I think we infer the relation detach by the fieldId being set to null at least for other object models
There's something that does not make sense here, maybe task have their own "static" implementation
Will give a look within the day
Do you guys want tickets for this kind of stuff on Github or what's your preferred way of communication on such topics?
I prefer not creating a github issues from now, I will try to give a quick a reproduction
Also this might be a REST funnel issue
Too many unknown points to raise an issue risking another dev to start digging in //
At least for this specific case
If you encounter a critical issue feel to do everything lol, creating an issue, dm me on discord etc
There is this one thing that is kind of killing my migration intent at the moment: The bodyV2 is not being displayed in the UI. Is this expected behavior?
I've answered in the other thread, you might be updating a deprecated field 🤔 but unless I'm mistaken the v2 field are the correct one ( also putting in light we haven't finished the migration )
And one more thing (sorry for that Columbo-move); E-Mails of former employees are also a critical issue. Could not find a way on how to sync those to the entities in the documentation. But if I lose that communication, it would seriously suck.
No worries I understand
Answered in your previous thread here https://discord.com/channels/1130383047699738754/1388859731367563314/1389536033783287870
Is there an ETA on this? Because at the moment that would be a blocker for me too. Our activity notes are all in HTML and I would rather not convert them to simple text.
I don't think we're planning to handle html semantic in notes, seems like that can still programmatically transpile from HTML to block using https://www.blocknotejs.org/docs/editor-api/converting-blocks#parsing-html-to-blocks
@charles do you have more information about that please ?
I actually meant because I can always turn HTML into markdown, but wouldn't want to convert it into pure text. No need for HTML at all on my side. Sorry for being unclear.
We definitely support markdown
Would test how it's done through the UI to determine what field to provide
As far as I can tell, the UI only provides the "body" field, not the bodyV2 (which I can successfully fill). There's a deprecated body field among the hidden ones, but that won't be relevant I guess.

Will give this a look today
I did research regarding this few months ago 😆
https://github.com/twentyhq/twenty/issues/10600
GitHub
Note with no bodyV2 causes errors · Issue #10600 · twentyhq/twenty
Preconditions: Working worker Scenario: Log in Go to Settings > enable Advanced > API & Webhooks Create new webhook and select all objects or notes Create new API key Using API, create ne...
Here's also a thread if you want to check https://discord.com/channels/1130383047699738754/1345401296894558268
Thanks for the research. Most unfortunate that this has not been fixed / updated yet. So at least I know that bodyV2 was only meant to be a temporary thing.