web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to extract string ...
Power Automate
Unanswered

How to extract string from plain text then classify and count them

(0) ShareShare
ReportReport
Posted on by 16

Hello all 

I would need your help to resolve it. Much appreciated 

 

I receive a PDF report every month, there are some testing results of the sample. Each month we have a different qty of samples. 

 

Each sample will have 2 tests we call them Type A and Type B, each type has either "Detected" or "Not Detected " as a result. 

 

Once I receive PDF ,  I need to count them and make a list below 

 

2023-08-31_08-56-01.png

Now I would like to have a flow to automate them and save results to SharePoint list 

 

I tried with Power automate AI, the model doesn't work well, so I used AI to extract all contents from PDF and convert to plain text as below.  but not sure how to classify and count them 

 

2023-08-31_08-44-37.png

Please let me know if you have a better solution or I am on a wrong track 

 

Thanks

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @awp426 ,

     

    You could use regular expression, for example:

    1\Get all results for type A (regular expression)

    (?<=type A)( |Detected|Not)*

     

    vbofengmsft_0-1693448611653.png

    2\Search numbers of 'Not Detected' in results in type A , you will get the number of not detected items for type A

    Not Detected

    3\Search numbers of  'Detected' in results in type A , you will get the number of all not detected items and detected for type A , then do the sub, you will get the number of Detected items for type A.

     

    Same for type B.

     

    About how to use regular expression in power automate , I think this link will help you a lot:

    https://www.tachytelic.net/2021/04/power-automate-regex/

     

    Best Regards,

    Bof

     

     

  • awp426 Profile Picture
    16 on at

    Thanks so much, Bof,  I have no experience in regular expression, but will give a try with your suggestion :)

     

     

  • awp426 Profile Picture
    16 on at

    Thanks Alex.

     

    When I insert regex search, it pops up below the error

     

    Request to Azure Resource Manager failed with error: '{"error":{"code":"InvokerConnectionOverrideFailed","message":"Could not find any valid connection for connection reference name 'shared_encodiandocumentmanager' in APIM tokens header."}}'.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard