Hi, really struggling with a flow processing engineer jobsheets.
It receives a HTTP request from their PDA's, processes the Json and adds it into two sharepoint list consisting of general information, and products used.
Everything in the general list gets added fine, but the products list is a little more troublesome.
- If there are no products listed, then the flow works perfectly.
- If there are two products, then the flow works perfectly.
- If there is one product, then the flow fails, with the following error:
Unable to process template language expressions for action 'Condition_2' at line '1' and column '2352': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#length for usage details.'.
If there is nothing in the array, then it will return Empty as 'true' in a condition, and exit the flow. If there are two products listed, then it processes fine in the 'Apply to Each' part of the flow importing the products.
I believe the issue I'm having is in the way that the Json is submitted from the PDA manufacturer.
Example of Two products in the Raw Json submitted via the HTTP request.
"Product1": [
{
"Qty": "3",
"Barcode": null,
"Item": "Eggs",
"Price": "3.50"
},
{
"Qty": "4",
"Barcode": null,
"Item": "Boxes",
"Price": "66.00"
}
],however when there is just one product, the below is the raw json:
"Product1": {
"Qty": "4",
"Barcode": null,
"Item": "Boxes",
"Price": "66.00"
},I believe my issues are relating to the fact that when there is one product, it's considered a string, rather than an array by the flow.
I'm at the end of my knowledge and would really appreciate some help processing the data what ever number of products are listed.

Report
All responses (
Answers (