Forum Discussion

Jamesvan_der_Wa's avatar
Jamesvan_der_Wa
Qrew Trainee
8 months ago

Processing incoming XML in webhook pipeline

Hi I have an XML file that contains stock levels that I want to import into a QB table via a webhook

The XML looks something like this:

<DSV_WHSInventory>
  <HEAD>
    <Message_Id>20230824010117</Message_Id>
    <Date_Time>20230824010117</Date_Time>
    <Message_Type>INVRPT</Message_Type>
    <Message_Version>0200</Message_Version>
    <Sender_Id>DSV_WMS_RP02</Sender_Id>
    <Sender_Company>DSV Solutions</Sender_Company>
    <Recipient_Id>ZAGOSOLR</Recipient_Id>
    <Recipient_Company>ZAGOSOLR</Recipient_Company>
  </HEAD>
  <Inventory>
    <Dstamp>20230824010117</Dstamp>
    <InventoryCount>
      <Client_Id>ZAGOSOLR</Client_Id>
      <Sku_Id>006</Sku_Id>
      <Site_Id>ZAGOSOLR</Site_Id>
      <Condition_Id>OK1</Condition_Id>
      <Total_Qty>42</Total_Qty>
      <Total_Alloc>3</Total_Alloc>
      <Tracking_Level>EACH</Tracking_Level>
      <Condition_Id_Map>OK1</Condition_Id_Map>
    </InventoryCount>
    <InventoryCount>
      <Client_Id>ZAGOSOLR</Client_Id>
      <Sku_Id>007</Sku_Id>
      <Site_Id>ZAGOSOLR</Site_Id>
      <Condition_Id>OK1</Condition_Id>
      <Total_Qty>27</Total_Qty>
      <Total_Alloc>3</Total_Alloc>
      <Tracking_Level>EACH</Tracking_Level>
      <Condition_Id_Map>OK1</Condition_Id_Map>
    </InventoryCount>

....

What is the best way to get this XML stock data into a QB table? 

Thanks for the help 



------------------------------
James van der Walt
------------------------------

2 Replies

  • As of my understanding today I don't believe there is a short / simple solution to it. There isn't anything in Pipelines that will convert XML to JSON unless you're using the Quickbase API. 

    I can't find anything about Jinja being able to parse a strict XML response but I could be wrong on that front. You could possibly write the entire XML payload into a Quickbase text field and try to use formulas to split it out and manage it somehow, but based on your sample payload that will get tricky given the list of inventory counts. Your best bet is to evaluate a non-pipelines solution and do either a codepage or custom script where you can access XML parsing libraries to be able to transform and load it into QB. 



    ------------------------------
    Chayce Duncan
    ------------------------------
    • Jamesvan_der_Wa's avatar
      Jamesvan_der_Wa
      Qrew Trainee

      Thank you! We've opted for a middle layer to fetch the XML doc and convert it first then forward it to a QB webhook. Either CSV or JSON. However, it seems that CSV is the easiest for QB to digest. 



      ------------------------------
      James van der Walt
      ------------------------------