Array of objects expected in parameter 'fields'

Hello,
I am new here and testing sync between mySQL DB and Google Firestore.
Both connections have been created successfully.
“Select row from Table” on mySQL module run properly and data is visible when it run.
But in the Firestore module, “Array of objects expected in parameter ‘fields’” error shows up.
Here is the screenshot.
I need help how to fix this. Thank you!

Could you please provide me with the JSON file of the scenario? This will allow me to review it and offer suggestions accordingly.

1 Like

Hi Rishabh_Mkhar

How could I retrieve the JSON file from my scenario? I am still learning. lol Thanks for prompt reply and your offer. :smile:

Just click on three dots and export blueprint:

2 Likes

Oh. I see. Here it is. TQ
blueprint.json (154.0 KB)

OutputBundle.json (8.7 KB)

Here is the output bundle file I just extracted from the mySQL module. That might give us some clue I think.

You need to build this mapped field using an array of collections.

Here’s how:

Every result (item/record) from a iterator module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

There are other types of aggregator modules, click the below links to find out more:

Read this

The Array Aggregator module allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

Here is an example of using the “Target structure type” of an Array Aggregator module:

As you can see, the “Map” toggle on fields are used when you have an array. You can easily build an array variable to map to a field, by using an Array Aggregator module and select the “Target Structure Type” as the future field you want to map the array into.

Alternatively, you can un-map this field, and manually add items to it.

3 Likes

Thank you. I have just been testing this aggregator. But run into a problem.
If Firestore is selected in “Target structure type”, only one field name and value can be added.
If multi fields/types are added, the whole data is combined in the firestore as one field.
If “Custom” is selected and pick all of the fields below, I got the error attached here.
Pls let me know how to fix it.