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 / PAD Processing complex...
Power Automate
Answered

PAD Processing complex text

(0) ShareShare
ReportReport
Posted on by 21

Dear Power Automate community,

 

do you know if there is a more elegant solution for working with large text files and looking up and trimming?

 

Problem

Let's jump to an example.  In the File below I am interested in getting back a list of values 1, 7, 13, 1.95. And of course the text can have different Input name and count.

{ 
Very long comment
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ven
iam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com
modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit 
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupi
datat non proident, sunt in culpa qui officia deserunt mollit anim id est 
laborum.
}

Inputs:

		int myInput1,
		int SwitchA(1),		 // comment with text and sometimes brackets
		int SwitchB(7),		 // comment with text and sometimes brackets
		int SwitchC(13),	 // comment with text and sometimes brackets	
 double N1(1.95); 	 // comment with text and sometimes brackets		 

consts:		

 

My solution:

First, cut the large text into only the area I need which sits between "conss:" and "Inputs:". I do this because sometimes the comment mentions a similar format and constants, of course, have a similar format.

 

After that, I am calling a Python script and using the Regular expression \((.*)\)[\,\;] which only selects values between brackets and things to get a little bit messy since I get back one string in Brackets. Unfortunately found no way to use regular expression directly for extraction, only super easy ones for trimming. After some cleanup I finally get a nice list of values I have to convert to numbers and we rollin. But the actions necessary are .... well look yourself:

JakubZizka_1-1633425601244.png

 

If anyone has any suggestions on how to make it nicer or easier I am all open to learning new things. Thank you for reading this far and I hope you have a great day.

Jakub

 

 

 

 

 

 

 

I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @JakubZizka 

     

    Regular expression for extracting characters between parentheses:

    (?<=\().+?(?=\))

     

    Please don't ask me abou it. I just searched the net and tested some of samples they provided. 🙂

     

    My flow looks very simple.

     

    shindomo_2-1633435903702.png

     

    Using action "Parse text" to extract and output a list of text values as variable %Matches%.

     

    shindomo_0-1633435476472.png

     

    As a result, you have a list of values 1, 7, 13, 1.95. Is this what you want?

     

    shindomo_1-1633435515093.png

     

    Thank you.

  • JakubZizka Profile Picture
    21 on at

    Hi @Anonymous ,

     

    i have completely missed this i could have sworn i saw only positions and not matches. I have to say this solves quite a bit of complexity for my Process. 

     

    Thank yo uso much for having a go at it at and helping out.

     

    Kind Regards 

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 468

#2
Haque Profile Picture

Haque 370

#3
Valantis Profile Picture

Valantis 354

Last 30 days Overall leaderboard