• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

Filter based on number of line items

Status
Not open for further replies.

GSG

Member
Hi

I am looking for a solution whereby I can 'filter' based on the number of items in line items array.

I would like the workflow only to continue if there is just the one line item.

Workflow so far is Woocommerce order > Pabbly Data Transformer, and before proceeding with further steps I would like to add the filter noted above.

Thanks for any suggestions or workarounds

Graham
 
P

Pabblymember11

Guest
I am looking for a solution whereby I can 'filter' based on the number of items in line items array.
You can use the Code by Pabbly action step to identify the number of line items and as a result, it will show the number of line items that you can use in the filter action step.

1688639148322.png


const lineItems = [1, 2, 3, 4, 5]; // Example array const numberOfItems = lineItems.length; console.log("Number of items:", numberOfItems);
 

GSG

Member
hey thanks for your help.

I don't get the same output info as you. Please see attached screenshot. It records output as logs. Am I missing something?
 

Attachments

  • Screenshot 2023-07-06 at 21.27.11.png
    Screenshot 2023-07-06 at 21.27.11.png
    347.8 KB · Views: 100
P

Pabblymember11

Guest
const lineItems = [1, 2, 3, 4, 5]; // Example array const numberOfItems = lineItems.length; [B]return[/B]("Number of items:", numberOfItems);

Kindly try passing the return in the last line.
 
Status
Not open for further replies.
Top