cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Can't get the field with "Get Items"

Hi Friend! Robson! From Brazil!

 

I'm in trouble here with a Flow, let me tell you.

 

First of all I have a connection with a SQL Server table, to work every time an item is inserted (a product).

When it happens, my flow goes to another table, when find the code of this product, and return the parts it it been made, that can be one or more.

 

For example: I have a product with id 12, and I insert it at table 1; 

BaixaEstoqueTabela1.png

 

After it, I go to table two and get all items that is related to FK_Produto 12; 

BaixaEstoqueTabela2.png

 

At Flow, all this information is corret, look (it returns from second table): {
  "@odata.context""",
  "value": [
    {
      "@odata.etag""",
      "ItemInternalId""",
      "Id_FichaTecnica"76,
      "Id_Produto"12,
      "Id_Item"2,
      "Quantidade"2.2,
      "Status""Ativo",
      "DataCadastro""2018-06-07T02:07:31.45Z",
      "CadastradoPor"""
    },
    {
      "@odata.etag""",
      "ItemInternalId""",
      "Id_FichaTecnica"77,
      "Id_Produto"12,
      "Id_Item"32,
      "Quantidade"0.2,
      "Status""Ativo",
      "DataCadastro""2018-06-07T02:07:43.667Z",
      "CadastradoPor"""
    }
  ]
}

 

At last part, I want to save it at the last table, multiplying the "Quant" field from first table to "Quantidade" field to the second. But, when I try to do it, this error happens:

 

InvalidTemplate. Não foi possível processar as expressões de linguagem do modelo nas entradas 'Inserir_linha' da ação na linha '1' e na coluna '2485': 'A função de linguagem do modelo 'mul' espera que seu primeiro parâmetro seja um número inteiro ou um número decimal. O valor fornecido é do tipo 'Null'.

 

Or in english: InvalidTemplate. Unable to process model language expressions in the 'Insert_line' entries of the action on row '1' and column '2485': 'The language function of template' mul 'expects its first parameter to be an integer or a decimal number. The value supplied is of type 'Null'. 

 

I'm using an expression to creat the mul result, that is this: 

mul(body('Obter_linhas')?['"Quantidade"'],triggerBody()?['Quant'])
 
I think that is this part that is not working, but I don't know that to do to fix it:
body('Obter_linhas')?['"Quantidade"']
 
Has anybody some idea?
 
Thank you so much.
 
Best regards,
Robson.
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Can't get the field with "Get Items"

Hi @rgparisoto,

 

You could add a Compose before the "Insert row" action inside the apply to each to get the expression of the Quantidade, and the expression of the Quantidade should as below:

 

items('Apply_to_each')?['Quantidade']

 

Best regards,

Alice

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Can't get the field with "Get Items"

Hi @rgparisoto,

 

Could you please share a screenshot of the configuration of your flow?

 

The error message told that the body('Obter_linhas')?['"Quantidade"'] is null so the mul() expression couldn't work.

 

 

Best regards,

Alice

Highlighted
Community Support
Community Support

Re: Can't get the field with "Get Items"

Hi @rgparisoto,

 

You could add a Compose before the "Insert row" action inside the apply to each to get the expression of the Quantidade, and the expression of the Quantidade should as below:

 

items('Apply_to_each')?['Quantidade']

 

Best regards,

Alice

View solution in original post

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,442)