Make.com LabIntermediate
Find a Character Position with indexOf() in Make.com
You want to split an email into username and domain. First, find where the @ sign is.
Live Execution Simulator
Idle
π₯
Incoming Data
βοΈ
Make.com Node
π―
Next Step
> Ready. Type your expression below and click "Check Answer" to run the node.
Incoming Payload / Data:
{
"email": "[email protected]"
}
Press Enter or click Check Answer. +20 XP
β Solution & explanation
indexOf(email; @)
Output: 4
indexOf(text; value) returns the position of the first match, counting from 0. Here s-a-r-a occupy positions 0β3, so @ is at 4. It returns -1 if the value is missing.π‘ Pro tip: Get the username with substring(email; 0; indexOf(email; @)).
Also accepted: indexOf(email; "@")