One-to-Many Import Post Response Map Script Preview Data

Comments

7 comments

  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    David Gollom it looks like postResponseMap is still within the path of one-to-many, but it looks like runtime isn't giving the _PARENT object. I just console logged this to test and am looking internally why _PARENT isn't there at runtime.

    0
  • David Gollom Strategic Partner
    Top Contributor
    Celigo University Level 4: Legendary
    Answer Pro
    Great Answer
    Engaged

    Hey Tyler,

    This makes sense.  There's no parent object and you have to access the target array with main record. Let me know what you find out.

    Thanks!! 

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    David Gollom sorry for the delay here, I met with engineering this morning and they're checking on expected behavior. Depending on that, we'll log an issue for it.

    0
  • Steve Klett Strategic Partner
    Celigo University Level 4: Legendary
    Answer Pro
    Great Answer
    Top Contributor
    Awesome Follow-up
    Engaged

    Hi Tyler Lamparter I'm not sure if it's related to what David Gollom reported, but I just struggled with a strange post response map script preview on a One-to-Many lookup. I'm adding this note to this topic because I suspect it's related.

    My situation is pretty standard: Exporting order data, for each line on the order I lookup additional product attributes. The API payloads are messy and I need to filter the lookup results to grab only an array element I actually care about. I was planning to use a Post Response Map script for this, but the Input and Preview data is whacky!

    My path to One-To-Many is 'lines' and I output mapped my lookup results to product_ex_data. I would expect to see Input preview like:

    {
      "postResponseMapData": [
        {
          "lines": [
            {
              "line_id": 14263214276915,
              "product_id": 8059359985971,
              "variant_id": 44195116941619,
              "product_ex_data": [
                {
                  "variant_id": 44195116941619,
                  "barcode": 843578102703
                },
                {
                  "variant_id": 441951169416198,
                  "barcode": 8435781027033
                }
              ]
            }
          ]
        }
      ],
    ...
    }

    where the lookup results are located in the "many" record. Instead the Input preview looks like this:

    {
      "postResponseMapData": [
        {
          "lines": [
            {
              "line_id": 14263214276915,
              "product_id": 8059359985971,
              "variant_id": 44195116941619
            },
            {
              "line_id": 14263214309683,
              "product_id": 8059371782451,
              "variant_id": 44195138928947
            },
            {
              "line_id": 14263214342451,
              "product_id": 8059786690867,
              "variant_id": 44196141891891
          }
          ],
          "product_ex_data": [
            {
              "variant_id": 44195116941619,
              "barcode": 843578102703
            },
            {
              "variant_id": 441951169416198,
              "barcode": 8435781027033
            }
          ]
        }
      ],
    ...
    }

    It's incorrect. If I actually run the flow and force an error I can see that the lookup data IS mapped to the child record as expected, but in the script editor you'd never know it.

    I've worked around this, but still happy to review with anyone if interested.

    0
  • Sree Vani Amara Principal Product Manager
    Engaged
    Answer Pro
    Celigo University Level 4: Legendary

    Steve Klett - Thank you for reaching out !  We are aware of this issue and actively addressing it.  

    0
  • Andrew Sanjanwala

    I'll tack myself on as someone experiencing the strange symptoms as documented by Steve Klett.  In my case, it feels like this specific issue manifested shortly after the latest feature rollout, though I have no way of confirming this as enhancement of this legacy script and subsequent debugging only began roughly around that time.

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Andrew Sanjanwala Steve Klett this should be resolved shortly. During runtime, everything is running as expected, but the UI preview is being incorrectly displayed. Since the UI preview is incorrect, it could lead you to building your script wrong. In the meantime, you can add console.log(JSON.stringify(options)) to the top of your script, enable debug on the script, then review what was logged. The logged JSON will be what you should use when building the script.

    0

Please sign in to leave a comment.