How to set the Advenced "Edit query" of "GetOrderData" for Payment Schedule Flow

Solved

How to set the Advenced "Edit query" of "GetOrderData" for Payment Schedule Flow

EunorauEbikes
Excursionist
23 0 6

As below picures show, i'm trying to "Get Order Data", then "add order tags", when PaymentTerms -> PaymentSchedules of the order are less than or equal to 0. So i can know when the customer paid the overdue payment and how many days the customer delayed to pay.

 

Last time,  i was told “ This can be done by adding a 'Get Order Data' step and using paymentSchedule.paymentTerms.order.id as the order_id in the query section. Next, they should iterate over the results and execute the 'Add Order Tags' step”.  

I tried add "order_id:{{ paymentSchedule.paymentTerms.order.id }}, and / or 

order_id:{{paymentSchedule.paymentTerms.order.legacyResourceId}}", and / or 
id:{{paymentSchedule.paymentTerms.order.id}}, OR
id:{{paymentSchedule.paymentTerms.order.legacyResourceId}}.
 
But all failed (except i got the email to notify me that the order get full payment).
Would someone here give me a hand to tell me where is the error, and how to fix it?

Thank u!!!

 

011.jpg012.jpg014.jpg

Accepted Solutions (2)

DaveMcV
Shopify Staff
104 31 29

This is an accepted solution.

Hi @EunorauEbikes,

 

The search syntax is:

 

id:{{someVariable.legacyResourceId}}

 

 So that is how you should construct the query. 

 

It would be worthwhile to add a Log Output step in the same branch as the Get Order Data action and set it as the same query string you're computing. This will let you know what the query looks like and you can continue to debug it. On the Order list page, you can copy + paste the output of the Log action into the query field -- it accepts the same syntax. It's possible that the query string is malformed or that some of the data does not exist. Debugging with the Log action is probably the best way to get to the bottom of what's happening.

 

Hope that helps!

DaveMcV | Flow Development 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.

View solution in original post

DaveMcV
Shopify Staff
104 31 29

This is an accepted solution.

You need to change the someVariable to the actual variables from the workflow. I was just providing the syntax, That's how it works for all Get data actions. More info can be found in the Shopify API Search Syntax docs, which should be linked from that action.

 

 

 

id:{{paymentSchedule.paymentTerms.order.legacyResourceId}}

 

 

DaveMcV | Flow Development 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.

View solution in original post

Replies 4 (4)

DaveMcV
Shopify Staff
104 31 29

This is an accepted solution.

Hi @EunorauEbikes,

 

The search syntax is:

 

id:{{someVariable.legacyResourceId}}

 

 So that is how you should construct the query. 

 

It would be worthwhile to add a Log Output step in the same branch as the Get Order Data action and set it as the same query string you're computing. This will let you know what the query looks like and you can continue to debug it. On the Order list page, you can copy + paste the output of the Log action into the query field -- it accepts the same syntax. It's possible that the query string is malformed or that some of the data does not exist. Debugging with the Log action is probably the best way to get to the bottom of what's happening.

 

Hope that helps!

DaveMcV | Flow Development 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.
EunorauEbikes
Excursionist
23 0 6

Thanks u, i will try it, and others you said are valuable for me too.

EunorauEbikes
Excursionist
23 0 6

An error here - ""someVariable" is invalid. Replace this variable."

001.jpg

DaveMcV
Shopify Staff
104 31 29

This is an accepted solution.

You need to change the someVariable to the actual variables from the workflow. I was just providing the syntax, That's how it works for all Get data actions. More info can be found in the Shopify API Search Syntax docs, which should be linked from that action.

 

 

 

id:{{paymentSchedule.paymentTerms.order.legacyResourceId}}

 

 

DaveMcV | Flow Development 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.