How to pick specific text componect using Logic App

Mahesh Madhusanka 176 Reputation points
2022-04-10T15:05:29.743+00:00

Hi Team,

Currently we have specific email body including Paragraph, According to we want to capture specific text part from the paragraph. how we can do it via Azure Logic app? According to below example require to capture S18035343355, appreciate your immediate support on this..?

ex:-

Number call Job Number S18035343355

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,873 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 68,986 Reputation points
    2022-04-11T04:20:54.397+00:00

    @Mahesh Madhusanka Thanks for reaching out. Logic app does have expression function and you can refer to this document for more details on the support expression.
    Unfortunately, as per your use case there are no expression functions that can help you. So, you need to either leverage the inline code to write your own code (JavaScript) for your requirement as below or you can offload this functionality to azure function. In cases where you don't want to use inline code, or the inline code cannot help then you can always use azure function and call azure function within logic app.

    For your requirement I have defined the variable and passed the text as per your sample text and used inline JavaScript code (match) to get the desired result.

    Note: ** The below is only for reference and the inline code will be changed as per what **action input/output you will be using for your inline code. Your logic app should be using Integration account as documented here.

    **Designer View: **

    191644-image.png

    JavaScript Code:

    let myText =workflowContext.actions["Initialize_variable"].inputs.variables[0].value  
    return myText.match(/S[0-9]*/g);  
    

    **Output: **
    191580-image.png

    Feel free to get back to me if you need any assistance.

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


0 additional answers

Sort by: Most helpful