Use a regular expression in a condition

  • Profile Image
    mediaarts
    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":"john@smith.com"}

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


  • Profile Image
    Kevin_G
    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: https://widgets.jotform.com/widget/substring 

    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. 

    https://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form 

    I hope this helps.