cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Karlo
Frequent Visitor

Help with building a flow based on text file

Hy people

 

I have specific problem., I have a flow that triggers when new text file is created in one drive

that text file contains messages divided with dashes

eg.:

 

text line something

new text line

PSM

AB1254

some text

etc

-------------------------------

text line something

new text line

PSM

SU67676

some text

etc

------------------------------

text line something

new text line

PSM

LM6432

some text

etc

------------------------------

dashes are always separator

 

I want that flow send each whole message beetween the dashes as separate email,

with subject line under PSM line eg LM6432 for last msg

but this text file sometimes repeat and I don't know how to send only messages that is not sent before.

 

I hope that someone can help me with this.

tnx

2 REPLIES 2
ScottShearer
Super User
Super User

@Karlo 

To get started, take a look at the split() expression - you'll split on the dashes and, in a different split, on PSM.

Give that a try and ask questions here if you get stuck.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Karlo
Frequent Visitor

 

@ScottShearer 

tnx for answer

but I am stacked with extracting each part of text between lines as new email

I get whole body as email.

with split function it only remove the lines.

or I get only one message first one

I use this:

last(split(first(split(outputs('Novi_red'),'-------------------------------------------------------------------------------')),'---------------------------------------------------------'

and I can get only first message how to get others one by one?

 

 

can you provide more help please

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,653)