I would like to "grab" numbers from a text field and then use the numbers in a calculation.
[Example text A] = "1 Pair per Bag, 12 Bags per Inner Bag, 12 Inner Bags per Case"
[Example text B] = "10 Eaches Box, 100 Boxes per Case"
I would like to create a formula field that grabs the above numbers in the sequence listed and multiple..
Example A  New formula field [1 * 12 *12] = 144
Example B  New formula field [10 * 100] = 1000
is this possible?
 180 Points
Posted 4 years ago
Ⲇanom the ultimate (Dan Diebolt), Champion
 30,434 Points
On the other hand this can done using script in a reliable way. This code fragment splits the text field on nondigits using a regular expression and then reduces the array by multiplying all nonempty terms together.
var field = "1 Pair per Bag, 12 Bags per Inner Bag, 12 Inner Bags per Case";
var terms = field.split(/\D+/g);
var product = _.reduce(terms, function(memo, item) {
return item.length > 0 ? item * memo : memo;
}, 1);
console.log(product);
logs 144
QuickBasePros (Laura Thacker), Champion
 6,396 Points
Ⲇanom the ultimate (Dan Diebolt), Champion
 30,434 Points
Questions, Answers and Points
https://haversineconsulting.quickbase.com/db/bj3fd38iz?a=er&rid=1
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=404
Gaurav Sharma, Certified Builder and Expert
 6,072 Points
instead of number can we pick usernames/email address from text field through this.
can you help me with your code ?
Thanks,
Gaurav
Ⲇanom the ultimate (Dan Diebolt), Champion
 30,434 Points
Gaurav Sharma, Certified Builder and Expert
 6,072 Points
can you give me code of email pattern ?
Related Categories

Formulas & functions
 3108 Conversations
 88 Followers

Tables & fields
 7399 Conversations
 204 Followers