cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

getting Template language function 'item' must not have any parameters error after adding a function

Hi All, I am new to power automate.

I built a flow that basically does this:

On form submission, it grabs certain selected fields and writes to a different excel file table. That part worked fine. I needed to add a feature where it needs to evaluate certain form fields for certain values and needs to write certain output values based on the conditions. I built a function expression, which does not give me an error when I check my flow, but the flow fails with the error upon running: 
"Unable to process template language expressions in action 'Add_a_row_into_a_table' inputs at line '1' and column '15822': 'The template language function 'item' must not have any parameters.'"

 

I exported and imported the flow, and I am pretty sure that is not the issue -since the flow works fine without the function. Its probably with the syntax of that function statement.

 

Here is the function statement:

if(or(equals(item(outputs('Get_response_details')?['body/rfabd17289f3b4dc9bae285dc5fcc1886']),'ENGL 121'), equals(item(outputs('Get_response_details')?['body/rb70aba84d6a24043921ca96a2f9d74cb']),'ENGL 121')),'6',if(or(equals(item(outputs('Get_response_details')?['body/r686b527f20aa4dacb1f3cc0d901d77e4']),'ENGL 099/121'),equals(item(outputs('Get_response_details')?['body/rfabd17289f3b4dc9bae285dc5fcc1886']),'ENGL 099/121'),'5',if(equals(item(outputs('Get_response_details')?['body/r686b527f20aa4dacb1f3cc0d901d77e4']),'ENGL 095'),'4','5'))))
 
which should be equivalent to excel logic:
IF(OR(equals(AH2, "ENGL 121"), equals(AJ2, "ENGL 121")),6,IF(OR(equals(AF2, "ENGL 099/121"),equals(AH2, "ENGL 099/121"),5,IF(equals(AF2, "ENGL 095"),4,'5'))))
 
which is basically,
if
AH2 = ENGL 121 or AJ2 = ENGL 121
output 6
else if
AF2 = ENGL 099/121 or AH2 = ENGL 099/121
output 5
else if
af2 = ENGL 095
output 4
else 
output 5
 
I can't figure out where is the issue in my FX statement that it is throwing this error. Any help is appreciated!!
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Perhaps I have it wrong because I cannot easily test your scenario, but I don't think you need the item expression at all, this might work...

if
(
  or
  (
    equals(outputs('Get_response_details')?['body/rfabd17289f3b4dc9bae285dc5fcc1886'],'ENGL 121'), 
	equals(outputs('Get_response_details')?['body/rb70aba84d6a24043921ca96a2f9d74cb'],'ENGL 121')
  ),'6',
  if
  (
    or
	(
	  equals(outputs('Get_response_details')?['body/r686b527f20aa4dacb1f3cc0d901d77e4'],'ENGL 099/121'),
	  equals(outputs('Get_response_details')?['body/rfabd17289f3b4dc9bae285dc5fcc1886'],'ENGL 099/121'),'5',
	  if
	  (
	    equals(outputs('Get_response_details')?['body/r686b527f20aa4dacb1f3cc0d901d77e4'],'ENGL 095'),'4','5'
	  )
	)
  )
)

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

View solution in original post

2 REPLIES 2
Highlighted
Memorable Member
Memorable Member

Perhaps I have it wrong because I cannot easily test your scenario, but I don't think you need the item expression at all, this might work...

if
(
  or
  (
    equals(outputs('Get_response_details')?['body/rfabd17289f3b4dc9bae285dc5fcc1886'],'ENGL 121'), 
	equals(outputs('Get_response_details')?['body/rb70aba84d6a24043921ca96a2f9d74cb'],'ENGL 121')
  ),'6',
  if
  (
    or
	(
	  equals(outputs('Get_response_details')?['body/r686b527f20aa4dacb1f3cc0d901d77e4'],'ENGL 099/121'),
	  equals(outputs('Get_response_details')?['body/rfabd17289f3b4dc9bae285dc5fcc1886'],'ENGL 099/121'),'5',
	  if
	  (
	    equals(outputs('Get_response_details')?['body/r686b527f20aa4dacb1f3cc0d901d77e4'],'ENGL 095'),'4','5'
	  )
	)
  )
)

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

View solution in original post

Highlighted
New Member

Paulie, 

Thanks so much! Your solution worked!!!

MS documentation was pointing me to use the item expressions.

 

You saved me a ton of wasted hours and agony.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Kudoed Authors
Users online (12,545)