Sharepoint get items gives me a set of items I use select to create an array to compare against another array that is similar to a excel-sheet.
one of the fields ("Size") in both SharePoint and Excel are decimal, and sharepoint assigns this to the "number" datatype(whatever datatype that is). The field is not required in SharePoint and neither should it be. I use various expressions like "if(empty(item()['field']), '', item()['field'])" to make sure that each item in the array corresponds with the one I will use to compare and merge with from excel.
This seems to be working just fine on empty strings and numbers(integers) etc, but does not seem to be the case for float. I can't use empty(), it fails with "cannot be evaluated because property 'Size' doesn't exist, available properties are ..."
I'd rather use Select and get the same result with a map, but as a workaround, I have to loop through every item and add them to an array use branching: I evaluate the optional float value in a compose and add two subsequent actions on success I do an append to array variable with the float field, on failure I do the same where the field is replaced with 'null'. This is the only field that I have this issue with, and there are multiple fields with blank strings but the property is still available. I have experienced similar issues when all the items in the get items have a blank value in a field, this is not the case here.
I realize I don't have to do the expression but rather just ref the compose, anyway, that is besides the point.
Is is there something wrong with the float value or "number" types in general?
Is there a better way to deal with inconsistently non-existent properties, it would be a lot cleaner to use Select instead.