I am a little confused on how to map a string array for a one to many import. I have several string arrays coming from in my payload and wasn't clear on what my transformation should look like. I was also wondering if I can “bundle” them (string arrays) all together under one object array for a single one-to-many import or if each would need its own object array (and thus its own one-to-many import step).
Sample Transformation of what I would like to do (Again assuming everything can be bundled into one object array).
Sample of Licensed States in my original payload:
"InWhatStatesDoYouHoldAnActiveInsuranceLicense": [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"Maryland",
"Nebraska"
],
Sample output from my transformation above:
"ProductsAndLicensedStates": [
{
"LicensedStates": [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"Maryland",
"Nebraska"
],
"SellingToAccountTypes": [
"Groups",
"Individuals"
],
"SellingProductTypes": [
"Major Medical",
"ClearShare"
],
"SellingOtherProductTypes": [
"Supplementals",
"Direct Primary Care"
]
}
],
@daveguderian I'm confused what you would like your output to be. Can you provide a sample desired output?
@tylerlamparter - Basically, I just want to know how to structure the transformation so that I can loop through the arrays in the ProductsAndLicensedStates Object so that I can use One to Many (again not sure if each one needs to be split into its own object or I can use one object (i.e. ProductsAndLicensedStates) and bundle all of them).
Below is a screenshot showing the Licensed States in SF. The other three fields (SellingToAccountTypes, SellingProductTypes, SellingOtherProductTypes) are a similar set-up in SF.
@daveguderian so you want to transform on an export step so that subsequent imports/lookups can loop through all of these? The one-to-many for imports/lookups do not work with string arrays, so you would have to make this a normal object array. However, you can't use transformation/mapper to map a string array to an object array. You can use transformation/mapper to combine string arrays into a single string array, like this, but since one-to-many doesn't support string arrays, this wouldn't help.
What you're left doing is using a preSavePage or a transformation script to convert all these string arrays to a single object array that can then be used for one-to-many. I would try using Celigo AI to build the script for you. Put a prompt in like: “combine the stringarray1 and stringarray2 fields into a single object array that has the structure like [{key:value}] where the key is just hardcoded to "key" and the value is each value in the string arrays”.