Logic app Experession error on SQL connector expression

Mahesh Madhusanka 176 Reputation points
2022-05-15T06:33:32.637+00:00

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
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,827 questions
{count} votes

2 answers

Sort by: Most helpful
  1. VenkateshDodda-MSFT 17,911 Reputation points Microsoft Employee
    2022-05-16T05:50:27.127+00:00

    @Mahesh Madhusanka 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. Kamlesh Kumar 3,861 Reputation points
    2022-05-16T18:07:00.063+00:00

    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.

    0 comments No comments