Support » Plugin: Calculated fields for ACF » Enhancement Request : math calc for string fields

  • Hey Guys! Thanks for an awesome plugin!!

    I would love to see an enhancement made for your calculations:

    1) sum( myTextField.IDEXOF(‘quick fox’) > 0 )
    this would allow searching for text fields, text areas, htmnl wsywig – we could be able to wrap the field values with functions: sum, min, max, abs, etc… to produce a numerical value

    Would like to see the string field functions that return numeric values be allowed to be used: charAt, charCodeAt, endsWith, includes, lastIndexOf, length, localCompare, match, search, startsWith, etc…

    any character function that returns a numeric should be supported.

    Use case: I setup a repeater field with a single “select list”, in the list is a selection: development, test, production. At the bottom of the repeating group I want to SUM( repeater.selectField.indexOf(‘production’) > 0 ) – to count the total number of times, someone selected “production” in the repeater group. I can use this in multiple ways.

    I think, as long as its a valid JS calculation that returns a number in to the aggregate function, I think it should be allowed.

  • The topic ‘Enhancement Request : math calc for string fields’ is closed to new replies.