• Resolved jefromcanada

    (@jefromcanada)


    I desperately need to be able to build strings in the formula editor. Concatenation of various fields is an essential missing element of the formula builder. Not all formulae require numeric inputs or outputs.

    Even if you do not intend to offer string functions in the formula builder, could you at least include some DETAILED Javascript tutorials so that people who are not very skilled with Javascript (me, for example) can get around this roadblock.

    Also, when attempting to work with Repeater fields, I am trying to use the GetField directive (with parameters: current and the FieldID). No matter what I try to do, I always get a syntax error during validation. I could really use some WORKING demo tutorials (because I’m following the instructions in current documentation and still getting syntax errors).

    Finally, I am trying to use conditional logic to show/hide fields within a repeater, and I cannot seem to be able to select the field to be hidden if that field is in a repeater group.

Viewing 4 replies - 1 through 4 (of 4 total)
  • USREC

    (@hawaiirealestate)

    We use new URL(window.location.href).searchParams.get(‘VAR’)

    Replace ‘VAR’ with your variable.

    Thread Starter jefromcanada

    (@jefromcanada)

    I’m sorry, but I don’t understand how this works. Are you saying that this function will return the string corresponding to a current variable on my form? If so, how does this help me do concatenation? I don’t know Javascript, so I don’t know how to use Javascript to concatenate strings and place the result into another variable.

    If you could offer a code snippet that accesses variable “A”, concatenates it with variable “B” and causes the result to be placed into variable “C”, that might give me enough information to learn from the example.

    My issue is that no matter what code I try to add to the “formula” builder, it always fails the validation process.

    Edit:

    I wanted to give a special shoutout to @hawaiirealestate. I followed the link to your profile, and I see you actively try to provide support to fellow members of the WordPress community with all manner of plugins. This is very admirable and I applaud your efforts.

    • This reply was modified 3 years, 4 months ago by jefromcanada.
    Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    To concatenate fields you need to use the .label property of each field.

    Example:

    [Field 1].label + [Field 2].label

    A formula like this would concatenate field 1 and field 2.

    Regards!

    Thread Starter jefromcanada

    (@jefromcanada)

    Thank you, Edgar. I’m assuming the fieldname must be in square brackets as shown in your example. If I want to include with the concatenation some random string, do I use “string 1” + “string 2”, where these strings are a literal string of arbitrary characters?

    • This reply was modified 3 years, 4 months ago by jefromcanada.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘String functions in formula editor’ is closed to new replies.