Using Regex to identify Entity on a Google Action Intent

76 views Asked by At

I have this Intent on Google Actions with a couple of utterances:

enter image description here

and I'm using one of the default system types:

enter image description here

The Bank Account should always be 8 digits so I was thinking if I could use Regex on Google Actions to identify this exact entity when typed by the user.

If yes, how exactly?

Can I just create an utterance with Regex like this: \d{8}

Should I "highlight" as Parameter just like I did with the two given examples as well?

Thanks,

1

There are 1 answers

2
Nick Felker On

While this is not visible in the Actions Console, it is something that can be done if you download the project to a local environment using gactions.

You can create a new Type in under custom/types. You will use create RegularExpression Entities.

regularExpression:
    entities:
        # `bankNumber` is your parameter name. It can be custom.
        bankNumber:
            regularExpressions:
                - \d{8} # In the `re2` syntax

Then you'll need to re-upload your project to the Actions Console with gactions push and gactions deploy preview.