cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
victor_lion
Helper II
Helper II

Create an Array from AI Builder

I'm using AI Builder to get fields from invoices, but there are some errors that could be mitigated by creating an array with all the itens identified from the conector. So is there a way to do that? I only managed to get an JSON and don't know exactly how to work with it, any help would be great.

5 REPLIES 5
fchopo
Super User
Super User

Hi @victor_lion 

What do you mean by creating an array? Do you mean having something like this?

[
{ "name":"Item1"},
{ "name":"Item2"}
]

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
victor_lion
Helper II
Helper II

Yes something like that, with the entries being the data that have been colected by the AI Builder, at the momment I have a JSON like this: 

[
  {
    "@odata.type": "#Microsoft.Dynamics.CRM.expando",
    "rowText": "Usage Charges $1.26",
    "confidence": 0.821,
    "fields": {
      "@odata.type": "#Microsoft.Dynamics.CRM.expando",
      "description": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "Usage Charges",
        "confidence": 0.9,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 1,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.4798117647058824,
            "top": 0.2985454545454545,
            "width": 0.1052352941176471,
            "height": 0.010645454545454569,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.4798117647058824,
                  "y": 0.2985454545454545
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.5850470588235295,
                  "y": 0.2985454545454545
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.5850470588235295,
                  "y": 0.30919090909090907
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.4798117647058824,
                  "y": 0.30919090909090907
                }
              ]
            }
          }
        }
      },
      "amount": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "$1.26",
        "valueNumber": 1.26,
        "confidence": 0.769,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 1,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.8942941176470588,
            "top": 0.29803636363636365,
            "width": 0.03576470588235292,
            "height": 0.009909090909090867,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.8942941176470588,
                  "y": 0.29803636363636365
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.9300588235294117,
                  "y": 0.29803636363636365
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.9300588235294117,
                  "y": 0.3079454545454545
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.8942941176470588,
                  "y": 0.3079454545454545
                }
              ]
            }
          }
        }
      }
    },
    "location": {
      "@odata.type": "#Microsoft.Dynamics.CRM.expando",
      "page": 1,
      "boundingBox": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "left": 0.4798117647058824,
        "top": 0.29803636363636365,
        "width": 0.45024705882352933,
        "height": 0.011154545454545417,
        "polygon": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
          "coordinates": [
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.4798117647058824,
              "y": 0.29803636363636365
            },
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.9300588235294117,
              "y": 0.29803636363636365
            },
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.9300588235294117,
              "y": 0.30919090909090907
            },
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.4798117647058824,
              "y": 0.30919090909090907
            }
          ]
        }
      }
    }
  },
  {
    "@odata.type": "#Microsoft.Dynamics.CRM.expando",
    "rowText": "43121229 07/25/2022 08/01/2022 $1.26 $.00 $.00 $1.26",
    "confidence": 0.176,
    "fields": {
      "@odata.type": "#Microsoft.Dynamics.CRM.expando",
      "date": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "07/25/2022 08/01/2022",
        "valueDate": "2022-07-25",
        "confidence": 0.579,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 2,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.15087058823529412,
            "top": 0.1391090909090909,
            "width": 0.17198823529411764,
            "height": 0.007463636363636367,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.15087058823529412,
                  "y": 0.1391090909090909
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.32285882352941175,
                  "y": 0.1391090909090909
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.32285882352941175,
                  "y": 0.14657272727272727
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.15087058823529412,
                  "y": 0.14657272727272727
                }
              ]
            }
          }
        }
      },
      "productCode": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "43121229",
        "confidence": 0.354,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 2,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.05898823529411764,
            "top": 0.1392,
            "width": 0.0574,
            "height": 0.007381818181818184,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.05898823529411764,
                  "y": 0.1392
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.11638823529411764,
                  "y": 0.1392
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.11638823529411764,
                  "y": 0.14658181818181817
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.05898823529411764,
                  "y": 0.14658181818181817
                }
              ]
            }
          }
        }
      },
      "amount": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "$1.26",
        "valueNumber": 1.26,
        "confidence": 0.478,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 2,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.7880235294117647,
            "top": 0.13865454545454545,
            "width": 0.03178823529411767,
            "height": 0.008809090909090933,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.7880235294117647,
                  "y": 0.13865454545454545
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.8198117647058824,
                  "y": 0.13865454545454545
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.8198117647058824,
                  "y": 0.14746363636363638
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.7880235294117647,
                  "y": 0.14746363636363638
                }
              ]
            }
          }
        }
      }
    },
    "location": {
      "@odata.type": "#Microsoft.Dynamics.CRM.expando",
      "page": 2,
      "boundingBox": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "left": 0.05898823529411764,
        "top": 0.13856363636363636,
        "width": 0.7608235294117647,
        "height": 0.008927272727272728,
        "polygon": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
          "coordinates": [
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.05898823529411764,
              "y": 0.13856363636363636
            },
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.8198117647058824,
              "y": 0.13856363636363636
            },
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.8198117647058824,
              "y": 0.1474909090909091
            },
            {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "x": 0.05898823529411764,
              "y": 0.1474909090909091
            }
          ]
        }
      }
    }
  },
  {
    "@odata.type": "#Microsoft.Dynamics.CRM.expando",
    "rowText": "Payments ($1.24)",
    "confidence": 0.805,
    "fields": {
      "@odata.type": "#Microsoft.Dynamics.CRM.expando",
      "description": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "Payments",
        "confidence": 0.889,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 2,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.06807058823529412,
            "top": 0.2507,
            "width": 0.06765882352941176,
            "height": 0.010509090909090912,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.06807058823529412,
                  "y": 0.2507
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.13572941176470588,
                  "y": 0.2507
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.13572941176470588,
                  "y": 0.2612090909090909
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.06807058823529412,
                  "y": 0.2612090909090909
                }
              ]
            }
          }
        }
      },
      "amount": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "valueText": "($1.24)",
        "valueNumber": 1.24,
        "confidence": 0.77,
        "location": {
          "@odata.type": "#Microsoft.Dynamics.CRM.expando",
          "page": 2,
          "boundingBox": {
            "@odata.type": "#Microsoft.Dynamics.CRM.expando",
            "left": 0.7687411764705883,
            "top": 0.2525818181818182,
            "width": 0.04504705882352944,
            "height": 0.011154545454545473,
            "polygon": {
              "@odata.type": "#Microsoft.Dynamics.CRM.expando",
              "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
              "coordinates": [
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.7687411764705883,
                  "y": 0.2525818181818182
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.8137882352941177,
                  "y": 0.2525818181818182
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.8137882352941177,
                  "y": 0.26373636363636366
                },
                {
                  "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                  "x": 0.7687411764705883,
                  "y": 0.26373636363636366
                }
              ]
            }
          }
        }
      }
    },
...
fchopo
Super User
Super User

Hi @victor_lion 

Could you provide an example of the output format of the array you want?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
victor_lion
Helper II
Helper II

I want something like:

 

[
  "item1",
  "item2",
  "item3",
  ...
  "itemN"
]

Where those itemN are the text that the AI Builder could retrieve from the invoice

fchopo
Super User
Super User

Hi @victor_lion 

You should add a "Parse JSON" action and then work on the values you get from that action (appending outputs to an array variable, for instance). I tried to do it on my own, but the output is incomplete. 

Hope it helps!

Ferran

 

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,063)