Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hey everyone,
We've started collecting a second email from our customers at sign-up (think accounting saas emails) and storing it in their profile notes. We did this because some of our customers use two emails and request invoices to be sent directly to their other email, not their primary one.
I've managed to pull this second email from the note, but I'm stuck on how to actually send the invoice there. Trying to use this email in the workflow keeps prompting for "get data." We tried it, but it didn't work.
Thanks
Solved! Go to the solution
This is an accepted solution.
Ok, the runtime error you are seeing is confusing. I think that is from an older version of the workflow.
For that error in Log Output, the problem is that you switched to a lower-case "output" field. It should look like:
type Output {
somevar: String!
}
So, I simplified it, and it half worked. I used the flow below, and it worked if the Note contains only an email. However, the note will always be like this:
Mobile Number: 11123456789
Personal Email: aaa@example.com
I tried using 'Run Code' to parse the note and use its output, but I keep getting this error ""output" is invalid. Replace this variable"
would appreciate any help... thnx
The core problem is that the action requires an order and not a draft order. It will not work with Draft Orders. I think you figured that out in the last post?
The run code problem - the variable outputted is not called "output". It starts with the step name because you could have 2 steps that output the same variable. Always use "Add a variable" when adding variables via liquid if you want to see the correct syntax. In this case, it's something like "RunCode.email"
Thanks Paul, yes the draft order wouldn't work, however I tried using "RunCode.email" with " Order Created" trigger and I ran into this error:
"Run code Value {"email"=>"xxxx@gmail.com"} is of type Hash but should be of type NilClass"
side q: is Run Code the only way to make this workflow function? or is there a more direct method? I mean I tend to overcomplicate things sometimes
That is a problem with your Run code step. I suspect that part where you assign it to matches[1] is actually undefined. Try matches[0].
Thank you Paul, for your time I really appreciate it. I understand if you decide to leave this post, you've already been a great help. I just want to provide an update. I tried matches[0] and got the same error.
Here are two examples I tested all of them got same error as my previous post "Value {....} is of type Hash but should be of type NilClass""
I use the Run Code to log out the customer tag, and I got the exact same error as shown in the image.
I use the Run code with a Note that has only an email in it, still same exact error in my previous post.
What variable are you using in Log Output? According to that code it should be {{ runCode.tag }} exactly.
I spent all my GPT-4 tokens on many possible scripts, and I ended up with the same exact error:
Value {"orderId"=>"5749155390000"} is of type Hash but should be of type NilClass
the below images for an example of trying to output the orderID. I thought it should be the most direct task
As for the Log Output step, I believe we are not there yet. We're still at the Run Code step, although I tried your suggested variable {{ runCode.tag }} and got this error: {"runCode" is invalid. Replace this variable} .. I also tried {{ RunCode.tag }} with the same error.
May I know if Run Code is the only way to make this workflow function using Shopify Flow?
thanks
This is an accepted solution.
Ok, the runtime error you are seeing is confusing. I think that is from an older version of the workflow.
For that error in Log Output, the problem is that you switched to a lower-case "output" field. It should look like:
type Output {
somevar: String!
}
Thanks a TON, Paul, for your patience. I really appreciate your support.
You were right, the problem was using "output" instead of "Output". The minute I corrected it, everything worked as it should be, even the Run Code process went through without any error
For anyone looking to use the customer profile Note data with their process using Run Code, here is what worked for me:
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024