Liquid, JavaScript, themes, sales channels
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:
KBK:
Tel:
BD:
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.
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.
User | RANK |
---|---|
38 | |
26 | |
13 | |
11 | |
8 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023