Parse Text
AnsweredHello
I have an app items that are created by mail ( Always the same text, machine created) I'd like to parse that text for the name in the body of text.
Is this possible ? and how / where can I get started ?
The eg text is :
Dear CFadmin,
You received the following notification:
New user Natalie has registered in group Users.
I need to pull out "Natalie"
-
Hi Stuart,
that is possible in 2 ways:
First: If you've access to the machine generated text and can change it, modify it to:New user has registered in group Users. Name: Natalie
If you have a field "Name" in the app, Podio takes the text behind "Name: " till the end of the line and puts it into the field "name" (Podio trys to map everything that looks like "fieldname": "value" into an existing field).
Second way: you can get the name into a calculation field
var a = @Textfield with Mail-text; var b = 'New user '; // string to be searched var c = b.length; // length of string to be searched var d = a.indexOf(b); // Position of string to be searched a.substr(c+d, a.indexOf(' ',c+d)-(c+d)) // gets first word of the text after search string which should be the name
Rainer
Please sign in to leave a comment.
Comments
2 comments