Shopify Flow Rule that Checks Whether the Street Number is Filled in the Address1 Field

Shopify Flow Rule that Checks Whether the Street Number is Filled in the Address1 Field

Caniboy
Shopify Partner
7 0 1

I need a Shopify Flow rule that checks in a created order if street number is missing in the field "order.shippingAddress.address1", because our customers regularly forget to enter the street number, or the autocomplete does not add a street number.


 Checkout allows addresses without a street numberCheckout allows addresses without a street number

 In Shopify Flow, I can't find a suitable condition to check if there is no street number missing in the "order.shippingAddress.address1" field.
 
Here is my example of the Shopify Flow rule I want:
 
1. "New created order" is the trigger.


2. A condition that checks if there are no missing digits at the end of the field "order.shippingAddress.address1", for example: (0-999)

3. the tag "valid-address" should then be added to the order as an action if this condition is met.
 
Background:
I think the pattern could somehow check for numbers at the end of the text string and one or more digits if the field "order.shippingAddress.address1" is correctly filled with a street number.
 
What method do I need for this? My ideas from the Shopify documentation would be:
- Logical Operators
- Data Type (e.g. Integer)
- Liquid variables (e.g.: Filter)
 
So far, unfortunately, my flow has not worked.

My Shopify Flow idea (but unfortunately it doesn't work yet)My Shopify Flow idea (but unfortunately it doesn't work yet)

 

Please let me know if you can help me or if you have any further questions.

Replies 7 (7)

paul_n
Shopify Staff
1336 151 304

A rather hacky way of doing it would be to check if the address includes 1,2,3,4,5,6,7,8,9,0

 

The other way to do it would be to use liquid and put the liquid directly in the tag field, where it outputs the tag your want if it is missing the number (and nothing otherwise). 

 

To test, I'd recommend you write that liquid in another action that you can easily see after running it (like Send email). Once it outputs the value you want, add all the liquid to a tag and hit enter. It will work

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
yszr
Not applicable
1 0 0

Hi Paul

Shopify provides 10,000 emails for free. Can't you use the quota from there to send an email to the customer? From the user's point of view, the only thing that needs to be stored is the Customer Email Liquid.

This would bring a significant added value for all Shopify users and reduce the manual effort.

Greetings
Yasin

Screenshot.png

 

paul_n
Shopify Staff
1336 151 304

If you want to send marketing automations, use Marketing / Automations as it uses Flow and has a Send Marketing Email action

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
mscmith11
Explorer
54 0 59

Hi Paul,

I am new to the Shopify Flow product. I am looking to run a query that tags an order with whether or not the "registered address" from the fraud analysis of an order matches the "shipping address" of the order. I don't see it on any templates.

I do see this one "Order.billingAddressMatchesShippingAddress". 

Are you able to help me? Thank you.

paul_n
Shopify Staff
1336 151 304

I'm not sure what "registered address" you are referring to. Maybe the one on the credit card? That address is not stored and thus not accessible on the order object. The closest you could get to that is to check for the exact text you see in that risk assessment. Here's the data path :

    "order": {
      "id": "gid://shopify/Order/9748...830",
      "risks": [
        {
          "display": true,
          "message": "Characteristics of this order are similar to non-fraudulent orders observed in the past"
        },
        {
          "display": true,
          "message": "Card Verification Value (CVV) isn't available"
        },
        {
          "display": true,
          "message": "Billing address or credit card's address wasn't available"
        },
        {
          "display": true,
          "message": "Billing address ZIP or postal code isn't available to match with credit card's registered address"
        },
        {
          "display": true,
          "message": "There were no payment attempts"
        }
      ]
    }

 

I'll note that these fields are changing in a soon to be adopted API (2024-04), so this solution will be slightly different after that (Flow typically performs these migrations for merchants where possible, or fixes the workflow to the version).

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
mscmith11
Explorer
54 0 59
Hi there,

Thank you for the reply. Yes, sorry for not being specific. The registered
address I was referring to is the one checked in the FRAUD ANALYSIS and
listed as such in the indicator details:

[image: 9fcf0476-9e89-4259-a17b-2371b97e2e80.png]

*Ultimately, we use the 2 lines referencing "Billing street address CC's
registered address" and "Billing address ZIP or postal matches the CC's
registered address" as the main determining factor in whether or not we
capture payment and process an order.
It would be great it we could add an automatic tag if these 2 lines are
TRUE.

Thank you,
Michelle
3ride Sports
paul_n
Shopify Staff
1336 151 304

The workflow would look like:

 

  1. Order risk analyzed
  2. Check if at least one of the order / risks / message == <The message you are trying to match>
    1. if true: add order tag
Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.