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

Community site session details

Session Id : 7Pi9dWxGineStueGWlwIsH
Power Automate - Building Flows
Answered

Having an issue with Split Function

Like (0) ShareShare
ReportReport
Posted on 23 Mar 2022 03:46:17 by

The flow should take an email submission from a form and create an event.

I have the date/times all working. I am just trying to get the subject title working and I can't figure out why.

Billy_Woods_0-1648006573970.png

I am converting the email body from html to plain text, and then into 'Compose'.

'Event Name (Cut Text After)' is removing all text after the event name successfully.

'Event Name (Cut Text Before)' should be removing all text before the event name, but does not appear to be finding the delineator.

Any help would be very appreciated.

Billy_Woods_1-1648006916283.png

Billy_Woods_2-1648006978087.png

Billy_Woods_3-1648007033879.png

Billy_Woods_4-1648007126078.png

 

  • Verified answer
    Community Power Platform Member Profile Picture
    on 24 Mar 2022 at 08:34:33
    Re: Having an issue with Split Function

    Thanks for your thoughts. I am using the html to text output as the base, just getting the line space in html changed to a /n in the code which throws off the split functions.

     

    I did some forum reading and found someone else having the same issue. It's a bit of a silly workaround but having a compose containing this fixed the issue:

    uriComponentToString(replace(uriComponent(body('Html_to_text')), '%0A'''))
    It takes the 'html to text' output and converts it to URI encoded, which is code friendly and changes /n (Which is new line) into %0A, which is URI encoded for means news line. It then replaces '%0A' with ' '.
     
    Taking the output of that function into all of my other functions fixes all issues i was having.
  • KvB1 Profile Picture
    1,596 on 24 Mar 2022 at 06:58:52
    Re: Having an issue with Split Function

    I can imagine that this will happen

     

    The safe thing would be to use the output of the html to text action as a base for your split functions, rather than the content of the mail

  • Community Power Platform Member Profile Picture
    on 24 Mar 2022 at 02:14:00
    Re: Having an issue with Split Function

    Yes. That's correct.

    I have fixed that issue by rewording "Name of Event/Project" in my form to "Event Name".

    However, the same issue is now occurring in the 'Start Time' function. 'Start time (Cut Text After)' function is: first(split(outputs('Start_Time_(Cut_Text_Before)'),'Finish Time')). 

    It is searching for 'Finish Time' then removing that and everything after that, leaving only the actual time.

    The Raw Output:

    Billy_Woods_0-1648087829026.png

    It seems that the "Html to text" is adding '/n' into the raw text which is throwing off the split() function.
    Html to text raw output below:

    Billy_Woods_1-1648088031253.png

     

  • KvB1 Profile Picture
    1,596 on 23 Mar 2022 at 10:50:15
    Re: Having an issue with Split Function

    In short, you want to end up with

    KvB1_0-1648032613504.png

    ?

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete