Hey n8n folks,
i am switching from make.com to N8N in the community version on my own hetzner server.
I build an automatic Account Creation incl. invite for new users Workflow.
Workflow Explanation:
- New Ghost Member
- Filter: Paid or free Member
- Paid member: Invite to discourse
This is my working JSON:
{
"email": "{{ $json.body.member.current.email }}",
"name": "{{ $json.body.member.current.name }}",
"username": "ToolGuide{{ Math.floor(10000 + Math.random() * 90000) }}",
"password": "{{ $json.body.member.current.uuid }}",
"active": "false",
"approved": "true"
}
On Username you see that i take: ToolGuide with a Random Number to create usernames.
Conclusion
The new member can change it later. I dont like it much, it was a workaround to start.
New Code Problems
Normally i would like to use the first characters on en email ex.
Therefore is this slightly different code:
{
"email": "{{ $json.body.member.current.email }}",
"name": "{{ $substring($replace($replace($substring($json.body.member.current.email, 0, $indexOf($json.body.member.current.email, '@')), '+', '_'), '-', '_'), 0, 20) }}",
"username": "{{ $substring($replace($replace($substring($json.body.member.current.email, 0, $indexOf($json.body.member.current.email, '@')), '+', '_'), '-', '_'), 0, 20) }}",
"password": "{{ $json.body.member.current.uuid }}",
"active": "true",
"approved": "true"
}
Question
How can i tell the N8N System that $json.body.member.current.email is a dynamic vairbale without the {{ }} at the end ?
thx for assist