Hi All,
I thought of something smart (not really), but it isn't working as expected. It seems to be a bug, but maybe I'm missing something.
I would like to perform the same actions on multiple SharePoint columns. To not have to create parallel branches or multiple flows, I want to put the column names in an array and loop through the array.
This is my flow:
This is the content of the array variable:
[
{
"Certificate": "Demeter",
"Column": "'DemeterGeldigtot'"
},
{
"Certificate": "Skal",
"Column": "'SkalGeldigtot'"
}
]
And this is the filter query of the filter array:
@not(equals(@{item()[items('For_each_Column')['Column']]},@{null}))
I'm referencing the variable in the item() function. Maybe this isn't possible.
This is the error I get from the "Filter array" action:
The execution of template action 'Filter_array_-_Cerificate_column_not_empty' failed: The evaluation of 'query' action 'where' expression '@not(equals(item()[items('For_each_Column')['Column']],null))' failed: 'The template language expression 'not(equals(item()[items('For_each_Column')['Column']],null))' cannot be evaluated because property ''DemeterGeldigtot'' doesn't exist, available properties are '@odata.etag, ItemInternalId, ID, Title, Code, Beoordeling, Status_x0020_obv_x0020_Transacti, E_x002d_mail, Landcode, Plaats, Adresregel1, Postcode, AangepastinExact, Status, IsConcurrent, IsDealer, Uitsluitenmarketing, Leverancier, Telefoonnummer, Startdatum, Geblokkeerd, ID0, Actief, Modified, Verkoop, IDHoofdcontact, Staat_x002f_Provincie, IsAccountant, Code_int, DemeterGeldigtot, SkalGeldigtot, GGGeldigtot, TypeRelatie, TypeRelatie#Id, IFSGeldigtot, LaatsteTransactieExact, Verklaring_x0020_nodig, VerklaringGetekendOp, Verklaring_x0020_Geldig_x0020_to, KwaliteitsbeoordelingJOST, KwaliteitsbeoordelingJOST#Id, ResidubeoordelingJOST, ResidubeoordelingJOST#Id, ToelichtingUitzondering, LastupdatePA, Test_x0020_Today, Now, Dummy, Created, Author, Author#Claims, Editor, Editor#Claims, {Identifier}, {IsFolder}, {Thumbnail}, {Link}, {Name}, {FilenameWithExtension}, {Path}, {FullPath}, {HasAttachments}, {VersionNumber}'. Please see https://aka.ms/logicexpressions for usage details.'.
Power Automate says the column 'DemeterGeldigtot' does not exist, but that is not true. It exists and there is no typo. If I try it with another column, it gives me the same error (with the other column name).
In this example I tried to put additional quotation marks in the array, to see if that helped. The same result, but with the additional quotation marks.
The Compose gives me the same output, nl.: 'DemeterGeldigtot'
This is the Input:
@{items('For_each_Column')['Column']}
Is this a bug or am I missing something. And maybe there is another way to achieve it.
*EDIT*
As a test, I have also tried to remove the for each loop and reference the first item of the array directly, with this expression in the filter query:
@not(equals(@{item()[variables('CertificateColumns')[0]['Column']]},@{null}))
This gives me the same result.