Forum Discussion
Geoffers
Nov 16, 2022Brass Contributor
Concatenate Fieldname into Expression
I have an Excel table with fields for Year1, Year2, Year3, Year4, Year5 I want to create a Sharepoint item in Power Automate for each. I have created an array ( [1,2,3,4,5]) I have an apply ...
- Nov 16, 2022Hi All
For anyone who cares, the correct syntax is -
outputs('Get_a_row')?[concat('body/Year', Items('Apply_to_each_financial_year'))]
So the concat is only applied to the "Body/year" part of the statement. Encompassing the entire output statement results only in a string that isn't evaluated.
ganeshsanap
Nov 16, 2022MVP
Geoffers Try using this expression if it works:
@{concat('outputs(''Get_a_row'')?[''body/Year', item(), ''']')}
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Geoffers
Nov 16, 2022Brass Contributor
Thanks for replying
concat('outputs(''Get_a_row'')?[''body/Year', Items('Apply_to_each_financial_year'), ''']')
The expression is happy to process the concat but then doesn't evaluate the result - it just populates Sharepoint with the string. If I add the "@" and "{}" symbols I get an "invalid" error.
BTW - your concat was missing its closing bracket 😉
concat('outputs(''Get_a_row'')?[''body/Year', Items('Apply_to_each_financial_year'), ''']')
The expression is happy to process the concat but then doesn't evaluate the result - it just populates Sharepoint with the string. If I add the "@" and "{}" symbols I get an "invalid" error.
BTW - your concat was missing its closing bracket 😉