HTTP workflow how to get related module field to post?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeffreysgrossman
    Member
    • Jan 2025
    • 91

    #1

    HTTP workflow how to get related module field to post?

    Can someone help me figure out what we are doing wrong? We are trying to build a workflow to post http to our ERP. We have a manual workflow button that is set to send HTTP request. Everything is working on the actual fields in the Deliver Order Module. However when we try to get a related module sub field we are not getting the workflow to pull and push that information.

    Code:
    {
      "orderNumber":    "{$number}",
      "deliveryDate":   "{$deliveryDate}",
      "customerId":     "{$customerId}",
      "customerName":   "{$customerName}",
      "totalAmount":    "{$totalAmount}",
      "shippingMethod": "{$shippingMethod}",
      "notes":          "{$warehouse.cDutchieLocationID}"
    }


    In the warehouse module we created a field and have the darta in that field. We are able to use the sandbox formula and pull the data in that way and it works. However when trying to do an HTTP Push it just does not.. It will just push over "$warehouse.cDutchieLocationID" instead.

    All the documentation we found seems like it "should" work. We are tying to not have to use Azure functions to store that data as well and just have it all come from Espo.

    Any help will be very much appreciated.

    Thank You,

  • lazovic
    Super Moderator
    • Jan 2022
    • 1113

    #2
    Hi jeffreysgrossman,

    In your case, you can try to insert the Execute Formula Script action before the Send HTTP Request action with the following content:
    Code:
    $warehouseId = workflow\targetEntity\attribute('warehouseId');
    $dutchieLocationID = record\attribute('Warehouse', warehouseId, 'cDutchieLocationID');
    Then, in the Send HTTP Request action, you can use the following variable: $$dutchieLocationID

    Comment

    • jeffreysgrossman
      Member
      • Jan 2025
      • 91

      #3
      lazovic that worked like a charm! Thank you so much!!!!

      Comment

      Working...