Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddedFieldDefinition: include option to use parent in interpolation_context #142

Open
marcosmarxm opened this issue Dec 6, 2024 · 1 comment

Comments

@marcosmarxm
Copy link
Member

marcosmarxm commented Dec 6, 2024

I want to include a field in my child stream using parent record information.
Example the API has orders and orderDetails endpoint.

Parent Record: orders

{
  "orderId": "12345",
  "customerName": "John Doe",
  "orderDate": "2024-12-06",
  "totalAmount": "150,75", 
  "status": "Shipped"
}

Child Record: orderDetails

{
  "orders": {
    "orderId": "12345",
    "orderDetails": [
      {
        "orderDetailId": "98765",
        "productName": "Wireless Mouse",
        "quantity": 2,
        "price": "25,50",
        "subtotal": "51,00"
      },
      {
        "orderDetailId": "98766",
        "productName": "Keyboard",
        "quantity": 1,
        "price": "99,99",
        "subtotal": "99,99"
      }
    ]
  }
}

Today is possible to include orderId because it is the key from the parent but if I want to include let's say status to orderDetail object it isn't possible.

@natikgadzhi
Copy link
Contributor

There is a workaround for this today, but you need to make a custom column on the parent record that contains a json represenation of multiple columns you want to access. Then you just use that custom column as parent "pk", and can key into it from the child stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants