Unable to Transform Data

Hello,

I am trying to use a model transformer to transform my input - bcl:System.Collections.Generic.List<System.Collections.Generic.List<System.String>> - into a more desired form - a table. In testing, I can compile my transformation code versions, but I get the below error in my flow. I have tried making a base case by manually setting an output value to a random string (not using my input data), but this results in the same error. Despite this test, I suspect it is due to the custom specification of my input data and backend JSON deserializing. To combat this, I got this custom output in flow, copied it as JSON then imported it as a model so I did not need any custom specifications. However, this generated model would not work with the data resulting in more errors. More specifically I believe the issue may be that my JSON input only contains values and is not the general format of{“name”:“value”}. However, I cannot seem to transform my data into this format, and I cannot change the input. Below is an example of the JSON of my input data. I have replaced the values with other values. Any help/insight would be greatly appreciated.

Best,
Andrew

TransformFailed

{
“text”: [
{
“value”: {
“value”: [
{
“value”: “column_name_1”
},
{
“value”: “column_name_2”
},
{
“value”: “column_name_3”
},
{
“value”: “column_name_4”
},
{
“value”: “column_name_5”
},
{
“value”: “column_name_6”
},
{
“value”: “column_name_7”
},
{
“value”: “column_name_8”
},
{
“value”: “column_name_9”
},
{
“value”: “column_name_10”
},
{
“value”: “column_name_11”
},
{
“value”: “column_name_12”
},
{
“value”: “column_name_13”
},
{
“value”: “column_name_14”
},
{
“value”: “column_name_15”
},
{
“value”: “column_name_16”
},
{
“value”: “column_name_17”
},
{
“value”: “column_name_18”
}
]
}
},
{
“value”: {
“value”: [
{
“value”: “hello world”
},
{
“value”: "hello world "
},
{
“value”: "hello world "
},
{
“value”: “12345”
},
{
“value”: “hello world”
},
{
“value”: “12345”
},
{
“value”: “hello world”
},
{
“value”: "12345 "
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “”
}
]
}
},
{
“value”: {
“value”: [
{
“value”: “hello world”
},
{
“value”: "hello world "
},
{
“value”: "hello world "
},
{
“value”: “12345”
},
{
“value”: “hello world”
},
{
“value”: “12345”
},
{
“value”: “hello world”
},
{
“value”: "12345 "
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “12345”
},
{
“value”: “”
}
]
}
}
]
}

1 Like

Hi again,

Instead of a model transformation, you could try to take the JSON above and create a model from it, then in the “usedResponseRange” model you use that new “text model” for the “text” column of type Object.

Hope this helps! (and that i am understanding the post correctly :slight_smile: )

B R
Ivan

Hello,

This is what I had tried previously but could not get to work. I end up getting an error like below when taking my output as a JSON and making it a model.

hello Andrew,

seems to be you are having larger data set therefore you have to split it in order to get it successfully.

private Model_GetPodDetails_OK_binary_ Image_to_binary(Model_GetPodDetails_OK input)

{

            var output = new Model_GetPodDetails_OK_binary_();

            //Transformation code start

            **output.data = new Model_GetPodDetails_OK_binary_.Embedded.data();**

            output.data.orderReferenceNumber = input.data.orderReferenceNumber;

            output.data.signatoryName = input.data.signatoryName;

            output.data.signatureTime = input.data.signatureTime;

            output.data.signatureImage = new System.IO.MemoryStream(Convert.FromBase64String(input.data.signatureImage.Split(',')[1]));

            //Transformation code end

            return output;

}

BR

Shyaminda

Hello,

This makes sense. Thanks.

Best,
Andrew