Use a regular expression in a condition

  • Profile Image
    Asked on October 02, 2017 at 12:16 PM

    Is there a way to use regular expressions to manipulate fields using an update/calculate condition?

    I have a widget that returns a json string and want to save the values of that into hidden fields. So wondering if can use a regex function in that "Do" section?

    For example to extract the amount from this json:{"amount":"15.00","email":""}

    I could use this regex: /"amount":"(.[^\"]*)"/

  • Profile Image
    Answered on October 02, 2017 at 12:47 PM

    Unfortunately, it's not possible to add such expression to the conditions wizard, but you could instead use a widget that will help you extracting certain string from a text.

    Please find the widget here: 

    Now, if you still need to implement your custom expression, then you may get the source code of your form and implement your own scripts, please note that you will need to update your source code if you make any change to the form through the form builder. 

    I hope this helps.