If - Then - Else with an action in between

Private Comment
This field is visible only to staff members and is for their reference only.
Consent to Access & Modify
I authorize Pabbly Support to log in to my account and make changes to the specified workflow for troubleshooting.
I wanted to create an if-then-else workflow. But cannot find how it works. I am new to Pabbly, so i am trying to learn

This is what i want to do.

I have a bookkeeping web app called Moneybird. And a WooCommerce website. When an order is created, I want to trigger the action to create the order via the Pabbly WooCommerce action.
Then the moneybird action needs to check if the customer exists. If the customer exists in Moneybird, then create the invoice. If the customer does not exist, create the customer first, then create the invoice.



How can I do that with Pabbly?


so:
Action: woocommerce order created
Check if the customer exists in Moneybird, If yes, create an invoice
If no, create the customer first, then create an invoice
 

ArshilAhmad

Well-known member
Staff member
Hi @GuillaumeGroen,

The use case you are describing is possible. Please follow the steps shown in the video below to set up WooCommerce as your trigger step and capture new orders.

Once you have done so, please share the workflow with us and we will guide you through the next steps.

Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
👉Rate your support
 
Thank you,

But this is only 3 steps. My third step can only commence if step 2 is done.
I probably have to create a router, and after that, add 2 steps that do almost the same thing? I cannot do an extra step in between.

-----------------------------------------------
Option 1(preferred option)
--> If no, Create a customer with order details |
| |
Order received -> check payment -> check if customer exists -> if yes, -> create invoice with received data.

Can I not make it like this?
------------------------------------------------
Option 2:
I probably have to create a router with 2 different extra checks: 1. If a customer exists, create an invoice, and 2. If a customer does not exist, create a customer and then create an invoice.

I then have to create the create invoice step twice, and if I need to change something in the last steps, I have to do that twice. (in step 1 and step 2)
------------------------------------------------
Can I create option 1? And if not, the new interface suits those types of workflows excellently.

Thank you,
 

ArshilAhmad

Well-known member
Staff member
Step 1: Capture a new order from WooCommerce using the ‘New Order Created’ trigger step.
Step 2: Use the ‘Moneybird: Search a Contact’ action step to check whether a contact exists in your Moneybird account.
Step 3: Router
• Route 1 – This will be used to create a contact and an invoice when the contact does not already exist in your Moneybird account.
• Route 2 – This will be used to create an invoice if the contact already exists in your Moneybird account


1764443833091.png


1764444071436.png


1764444126640.png
 
Ah, thank you. This is what I thought, too. I hoped to put in a middle step. Now I have to build the Create sales invoice twice. This can create errors because they need to be the same. If I could create just one, that would be great.
I would need a reverse router, or maybe a combinator that combines two routes into one.
Where can I request a feature for the future?

This would help to simplify workflows because I only have to create the sale invoice once. Now I have to create it twice. This workflow is not that complex. But if they become more complex, simplifying them would be in troubleshooting and maintenance.
 

Soumya Tripathi

Member
Staff member
Hello @GuillaumeGroen
You don’t need to worry — the workflow will not create the sales invoice twice.

Even though you are adding the “Create Sales Invoice” action inside both routes of the Router, only one route will execute at a time based on the condition:

  • If the customer exists → Only Route 2 runs → Invoice created once
  • If the customer does NOT exist → Only Route 1 runs → Customer created → Invoice created once
Pabbly Connect never executes multiple routes simultaneously.
Only the matching route continues, so the invoice is generated only one time, not twice.
 
Great!
Is there a way to choose one of the invoice layouts that I have configured in Moneybird?

And how to proceed if there are more lines in the order? i can add only 1 line item.

And how do i arrange sending of the order? it stays as a concept
 

Preeti Paryani

Well-known member
Staff member
Hello @GuillaumeGroen,

Regarding selecting one of your predefined invoice layouts in Moneybird — currently, this is not supported while creating a Sales Invoice in Pabbly Connect. However, you may add this as a feature request on our roadmap. Once added, please share the link with us so we can keep track of it:
https://roadmap.pabbly.com/b/Update-Existing-Application

For adding multiple line items, please refer to the below tutorial. It explains how to capture multi-line order data, convert it into comma-separated values, and then map those values properly inside the Create Sales Invoice action:
 
Thank you for the clip. But this adds all the line items in 1 line. I need every line item in a separate line in a sales invoice from Moneybird. Do I have to loop until empty? How can I proceed best?

I would also like to set a json setting called document_style_id but i cannot place extra json lines in the workflow? Because i use multiple invoice layouts i need to set the correct one via or in pabbly. https://developer.moneybird.com/api/document-styles#list-all-document-styles
and if ledger_account_id is added or that i can add mappings myself in maybe an extreme advanced setting. I need to add a product category to the moneybird invoice. https://developer.moneybird.com/api/ledger-accounts
 
Last edited:

ArshilAhmad

Well-known member
Staff member
No, it won’t add all the line items in a single line—that behavior is specific to MS Excel. When you pass comma-separated values from the Line Itemizer to the Moneybird: Create Sales Invoice (with Line Items) action step, they will be treated as separate line items and will not appear in a single line.
1770315765857.png



Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
👉Rate your support
 
Hi Arshil, I found it out. With a data processor, I can do what I need. The only thing I would add is the option to use a category in the line items, so I can assign the WooCommerce product category as an invoice category for bookkeeping.
Since we have multiple web shops, I want to add document_style_id so I can specify the invoice layout. So that the invoice is sent to Moneybird in the correct format.

Or should I build it myself with the API by Pabbly step?
 

Preeti Paryani

Well-known member
Staff member
Hi @GuillaumeGroen,

For the time being, you can use a Custom API Request / API by Pabbly to perform this action and pass the required fields.

We have escalated a request to add these fields to the Create Sales Invoice (with Line Item) native action. Once the fields are added, we will inform you so you can switch back to using the native action directly.
 
Thank you. What is the timeline for this normally? Are we talking weeks or months? I am preparing for a near-future use. But it has to be operational in the coming weeks. I will prepare the API, but if I could avoid it, it is better. Configuring the API takes much more time.
 

ArshilAhmad

Well-known member
Staff member
We won’t be able to provide an exact ETA at the moment, but rest assured our team is actively working on it. The fields will be added very soon.

Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
👉Rate your support
 

Preeti Paryani

Well-known member
Staff member
Hello @GuillaumeGroen,

Thank you for your patience.

Our team has updated the action, and you should now be able to select the style and layout while creating the invoice. We request you to please test the action once and check the sample response to see how it works.

If you face any issues or need further assistance, please let us know—we will be happy to help.
 
Thank you, I can see the ledger account ID in the moneybird action but i cannot map it. I added the ledger_account_id as a line-item. And using the data formatter line-itemizer i see it in the data but it i cannot see it in the moneybird action.
These are my line-items: And i created a line-item 'moneybird_ledger_account_id'.

[{"id":382,"name":"Doppio Verde Dummy Course","product_id":15,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"12.40","subtotal_tax":"2.60","total":"12.40","total_tax":"2.60","taxes":[{"id":1,"total":"2.60","subtotal":"2.60"}],"meta_data":[],"sku":"Online Cursus","global_unique_id":"","price":12.396694,"image":{"id":"","src":""},"parent_name":null,"moneybird_ledger_account_id":"184609343077877459"},{"id":383,"name":"Doppio Verde Dummy Course (2)","product_id":140,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"82.64","subtotal_tax":"17.36","total":"82.64","total_tax":"17.36","taxes":[{"id":1,"total":"17.36","subtotal":"17.36"}],"meta_data":[],"sku":"","global_unique_id":"","price":82.644628,"image":{"id":"","src":""},"parent_name":null,"moneybird_ledger_account_id":"184609343077877459"},{"id":384,"name":"Doppio Verde Dummy Course (3)","product_id":141,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"2.69","subtotal_tax":"0.56","total":"2.69","total_tax":"0.56","taxes":[{"id":1,"total":"0.56","subtotal":"0.56"}],"meta_data":[],"sku":"","global_unique_id":"","price":2.68595,"image":{"id":"","src":""},"parent_name":null,"moneybird_ledger_account_id":"184609343077877459"}]

Is this normal? is there a limitation somewhere?
 
Top