FAQ: How can I reference fields outside the “Path to many” in my import settings?

Question: I need to reference fields that are outside of my Path to many path in my import’s settings. How can I do this?

Answer: You can append _PARENT before any fields that you need to reference outside the Path to many that you set in your import. Note that ALL fields referenced anywhere in the import (mappings, import configuration, scripts, etc.) will be affected when One to many is set to Yes (advanced).

For example, let's say your import data looks like this:

{
"exampleField": "value",
"exampleArray": [
{ "innerField": "innerValue1" },
{ "innerField": "innerValue2" },
]
}

In this case, you would set your Path to many path as "exampleArray", so that it will iterate through the objects in that array. To reference "exampleField", you can use the following in the mappings:

_PARENT.exampleField

To reference the inner fields, you can just set them as standard mappings. Another example comparing One to many set to No versus set to Yes (advanced) for line level fields, you would change your mappings to this:

exampleArray[*].innerField --> innerField
1

Comments

3 comments
Date Votes
  • can you please tell me what keyword should we use when the export data is in SOQL format?

    0
  • Hi Giridhar Darapuneni,

    One to many setting should show changed sample data in the import mappings. It doesn't matter whether the export is SOQL or anything else. integrator.io converts it to JSON, and then you can enter an array field name in the one to many field. Everything outside of that array will automatically use "_PARENT."

    Tom

    0
  • Hi Tom,

    I would like to update one point here.

    When using the one to many feature. The "path to many" field should be updated with exampleArray without the double codes. Then it works. Basically the use case here is - If someone wants to create multiple records in the destination from a single parent object. We will need to make sure three things:

    The export data should be in JSON with arrays underneath that.
    Use the Array element name without double codes which in this case is exampleArray.
    In the mapping, to reference data outside of the array / Path to many,  reference them by _PARENT.
    ie: _PARENT.exampleField

    Cheers,
    Vikash

    1

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post