Can I validate number existence in custom fields on a registration form?

Shopify Partner
4 0 2

Hello, everyone!


I'm looking for some help with assigning customer notes as metafields.

What I've basically done is added some custom fields to registration form to be added as notes for the newly created customer. If none of them are filled, the Notes output will look like this:





If all of them are filled, the output will look like:

KBK: 8123

Tel: 12345678

BD: 13.08


So, in order to then convert them to a metafield value, I wanted to use Shopify Flow to assign the values to metafields with a condition [IF customer notes CONTAINS KBK] (or Tel or BD), and thought that I'd slice the whole Notes section to get the data I need. In this example the only value I want to assign to the first metafield is "8123".

I thought it would not put the KBK title in the notes if it's not filled, but unfortunately it does, so if I set the condition to CONTAINS KBK, it will trigger every time.


So my question is - is there a way of creating a validation that would also look for numbers, like CONTAINS KBK: ####, so it would work only if it's not blank. The same with Tel: ######## and BD: ##.##.


Or maybe you can suggest a better way of achieving this? Without any additional paid apps, please.

Screenshot 2023-11-09 191503.png

Screenshot 2023-11-09 191637.png


Additional question: is there a way to make a validation if such number already exists in KBK value? For example, I register with a number that someone already has in their metafields? These numbers should be unique, but we want to automate the process, thus we'll allow the customers to enter them themselves, so I'm afraid that someone could potentially type in a number by mistake that already belongs to someone else.

Replies 0 (0)