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

Xpath returns null value

Hi,

 

I'm getting null value when I tried to get sessionID using below function. Please help me on this.

 

xpath(xml(outputs('HTTP')),'//*[Local-name()="Envelope"]/*[Local-name()="Body"]/loginResponse/result/sessionId')

 

HTTP post request output (body):

 

<?xml version="1.0" encoding="UTF-8"?>
    <Soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLschema-instance">
<Soapenv:Body >
<loginResponse>
<result>
<metadataServerUrl>https://salesforce.com/services/soap/35.0</metadataServerUrl>
<sandbox>false</sandbox>
<sessionId>00RREg646744nnhd73636884</sessionId>
<userInfo>
<LoginName>Company</LoginName>
</userInfo>
</result>
</loginResponse>
</Soapenv:Body >
</Soapenv:Envelope>

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: Xpath returns null value

@Ajay3 

 

Your XML does not seem to be valid, when I try to convert the SOAP Envelope to XML it gives me the error. 

 

Unable to process template language expressions in action 'Compose_2' inputs at line '1' and column '2860': 'The template language function 'xml' parameter is not valid. The provided value cannot be converted to XML: ''Soapenv' is an undeclared prefix. Line 2, position 3.'. Please see https://aka.ms/logicexpressions#xml for usage details.'.

 

So I pasted it in an online XML validator and I got the same error. You can also validate XML at https://www.xmlvalidation.com/index.php?id=1&L=0 

 

CFernandes_0-1599990313618.png

 

That being said, In my blog I have explained how to get a value from the SOAP Envelope (Step 5 to Step 6C) : https://clavinfernandes.wordpress.com/2019/11/12/create-a-flow-using-the-soap-connector/ 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

2 REPLIES 2
Highlighted
Resident Rockstar
Resident Rockstar

Re: Xpath returns null value

@Ajay3 

 

Your XML does not seem to be valid, when I try to convert the SOAP Envelope to XML it gives me the error. 

 

Unable to process template language expressions in action 'Compose_2' inputs at line '1' and column '2860': 'The template language function 'xml' parameter is not valid. The provided value cannot be converted to XML: ''Soapenv' is an undeclared prefix. Line 2, position 3.'. Please see https://aka.ms/logicexpressions#xml for usage details.'.

 

So I pasted it in an online XML validator and I got the same error. You can also validate XML at https://www.xmlvalidation.com/index.php?id=1&L=0 

 

CFernandes_0-1599990313618.png

 

That being said, In my blog I have explained how to get a value from the SOAP Envelope (Step 5 to Step 6C) : https://clavinfernandes.wordpress.com/2019/11/12/create-a-flow-using-the-soap-connector/ 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

Highlighted
Community Support
Community Support

Re: Xpath returns null value

 

Hi @Ajay3 ,

 

Have you had an opportunity to apply any of @CFernandes 's recommendations to adapt your Flow? I did a test on my side and the results are consistent with what CFernandes described. It seems that the XML data you provided is in the wrong format.

 

Please refer to @CFernandes 's suggestions to modify the configuration and feel free to let us know if you have any other questions.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (6,645)