T
Twenty3w ago
fendle

Is it possible to have next to the ID as well kind of People or Company Number?

Good morning, is it somehow possible to have a People / Company Number which is automatically filled with an ascending number? Doesn't matter if created by API or Gui? Than the user can easily share a specific customer set on the phone with a colleague or they can earch by it.
9 Replies
ɃØĦɆᵾS
ɃØĦɆᵾS3w ago
It's possible with workflow, you have to trigger it by creating a record and using code node, find max id of record, add 1 to it and update field of newly created record
fendle
fendleOP2w ago
Cool, I will try it. Thanks Hi, another question. Why would I use the code node and not the http request not to get the entry with the highest number? I would sort by desc by this fields and limit to 1
ɃØĦɆᵾS
ɃØĦɆᵾS2w ago
That's one of few ways to solve your problem, in the end it's up to you how you solve it
fendle
fendleOP2w ago
that's clear, I am only interested (want to learn) how you would do it with javascript code. Would you do there a call to the backend? or is there kind of javascript method within Twenty which I could use?
ɃØĦɆᵾS
ɃØĦɆᵾS2w ago
Straight up call to API as there are no native methods exposed
fendle
fendleOP2w ago
Hi, is there any documentation how the workflows works? I haven't really found documentation or tutorials and asked chatgpt. The http call is working, but how would be the next step in the code node?
Prastoin
Prastoin2w ago
Hey @fendle you can find some workflow docs at https://twenty.com/user-guide/section/integrations/workflows
Twenty - Workflows
Understand the workflow feature in Twenty including how to create and delete workflows, configure triggers, add actions, run workflows, and manage workflow history.
fendle
fendleOP2w ago
I saw this documentation, but I was't sure how it will be returned from the http node. how to access the data from the code node and return it back to the update object again. I am quite familiar with N8N and doing there a lot and in general I am clear with the concept
ɃØĦɆᵾS
ɃØĦɆᵾS2w ago
@fendle do you have a expected response body in HTTP Request node? In order to use returned data from HTTP Request node in Code node, you have to provide an example to work on it in next nodes (here's a solution how to do it https://discord.com/channels/1130383047699738754/1130383048173682821/1419973025780203600)

Did you find this page helpful?