cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Referencing a the value of a SharePoint item in the Outputs() function

I am new to the syntax of expressions in Power Automate and I just can't get my head around how to reference a SharePoint column in the outputs() function. I need to perform a replace operation on the column 'Wording' and I am trying something like this:

 

replace(outputs('Action')?[body/Wording],'from','to')
 
Something in the underlined section is not correct.
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Okay, I gave up and just initialized another variable to hold the contents of the Wording column and than used both variables in the replace function as follows:

 

DustyMac_0-1601565775930.png

The expression now reads as replace(variables('varWording'),variables('varNewLine'),'<BR>') and it works as expected.

View solution in original post

7 REPLIES 7
Highlighted
Frequent Visitor

It is no longer complaining if I change it to:

 

replace(triggerOutputs()?['body/value']?['Wording']?['Wording'],'from','to')
Highlighted

This is the final expression (so far)

 

replace(triggerOutputs()?['body/value']?['Wording'],variables('varNewLine'),'<BR>')

 

It compiles, but generates the following on execution (Wording is not empty):

 

InvalidTemplate. Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '15076': 'The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#replace for usage details.'.

Highlighted

Hi @DustyMac 

The expression you had used is correct, but you have to confirm the below before trying to replace.

  • triggerOutputs()?['body/value']?['Wording'] should not be empty or null.
  • variables('varNewLine') should not be empty or null.

The error thrown below is because the value of the expression variables('varNewLine') is Null.

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...
Highlighted

I am a bit baffled. varNewLine is initialized to a single Enter key (newline character) and Wording is a mandatory field in the SharePoint list and is not permitted to be empty.

Highlighted

I removed the replace() function and am now left with triggerOutputs()?['body/value']?['Wording']. This did not output anything, so the reference may be incorrect.

Highlighted

This is what the flow looks like. Is it possible that triggerOutputs is referring to the Initialize variable step rather than the trigger step?

DustyMac_0-1601563744936.png

 

Highlighted

Okay, I gave up and just initialized another variable to hold the contents of the Wording column and than used both variables in the replace function as follows:

 

DustyMac_0-1601565775930.png

The expression now reads as replace(variables('varWording'),variables('varNewLine'),'<BR>') and it works as expected.

View solution in original post

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 Solution Authors
Top Kudoed Authors
Users online (1,644)