• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

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: 144
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