question

MaheshMadhusanka-3900 avatar image
0 Votes"
MaheshMadhusanka-3900 asked VenkateshDodda-MSFT commented

Logic app Experession error on SQL connector expression

Hi Team

Currently we have requirement to get a pervious connector output string parse to execute SQL query connector as a variable. According to I have created below LA workflow and got a expected output however value parse with additional character as below, Could you please help to pick exact value from previous connector

Logic app Workflow-
202062-image.png

202033-image.png


Current Value- ["S14022035258"]
201985-image.png

Expected Value - : S14022035258

Current Condition Expression - :
replace(outputs('Execute_JavaScript_Code')['body'],'"','') Current output-: ![202014-image.png

According to need to remove - [" and "] from string


azure-logic-apps
image.png (11.5 KiB)
image.png (43.7 KiB)
image.png (9.4 KiB)
image.png (31.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Team,

Any Update on this....?

0 Votes 0 ·
VenkateshDodda-MSFT avatar image
0 Votes"
VenkateshDodda-MSFT answered VenkateshDodda-MSFT commented

@MaheshMadhusanka-3900 Thanks for reaching out, you need to apply double replace in order to remove special characters [""] from the output of Execute JavaScriptCode action. I have tested the expression below and it is working fine from my end.

 replace(replace(outputs('Execute_JavaScript_Code')['body'],'["',''),'"]','')

Could you please update the replace expression in your workflow and test it from your end as well Feel Free to reach back to me if you have any further questions.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HI @VenkateshDodda-MSFT Thank you for your response, however faced new issue as below, Kindly check and advise on this..?

202259-image.png


0 Votes 0 ·
image.png (28.1 KiB)
VenkateshDodda-MSFT avatar image VenkateshDodda-MSFT MaheshMadhusanka-3900 ·

@MaheshMadhusanka-3900 you can apply replace expression functions to replace a substring in a specified string. As per the error message, the output value of replace function in compose action is of type Array that is the reason you compose action got failed. Can you change the replace expression in the compose action with the below

 replace(replace(string(outputs('Execute_JavaScript_Code')['body']),'["',''),'"]','')

Feel free to reach back to me if you have any further questions on this.

0 Votes 0 ·
KamleshKumar avatar image
0 Votes"
KamleshKumar answered

Hi There,

Thank you for asking this question on the Microsoft Q&A Platform.

I suspect your input is coming in Array type and I would suggest to parse your input like below screenshot and then take a value. I just created a sample LA with input

 [
   "S14022035258"
 ]

202290-image.png

Regards,
Kamlesh Kumar
BizTalk Techie

If this answer solved your problem, please click the Verify Answer button (found below the answer) to help other users who have the same question.




image.png (26.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.