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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Split function differe...
Power Automate
Unanswered

Split function different behavior Flow vs Logic App

(0) ShareShare
ReportReport
Posted on by 329

Dear Community Members,

 

I am in the middle of building a workflow that should import the data of a CSV file into a SharePoint list.

First step for me is to follow this article by sergeluca https://sergeluca.wordpress.com/2018/10/28/microsoft-flow-advanced-tutorial-creating-a-csv-converter-from-scratch/ to get a basic understanding of how to work with this scenario.

 

I already know that there are slight differences between Microsoft Azure Logic App and Microsoft Power Automate, but I can't get my head round the following behavior.

 

I have rebuilt the flow presented by the article owner in both Power Automate and in Logic App. 

In the first action I initialize an Object variable. So far so good for both workflows (Power Automate and Logic App).

In the second action I use Compose to compose the CSV data. So far still good for both workflows.

In the third action, a split is performed.

 

The person mentions:

"

there is currently an issue in the flow editor when we use the linefeed character, so we have to explicitly type the logic app code. Add a Compose action, name it Table and add the following code in the input (not in the expression, and keep the double quotes):

“@split(outputs(‘CSV_Data’), ‘\n’)”

"

 

When I do as the article owner says, it works in Power Automate. Logic App however couldn't care less:

2020-01-31 23_39_42-Run History _ Power Automate.png

 

I try to use split in Logic App to do the same thing. You'll notice the result in the screenshot above. Seems that it does not recognize the \n in the CSV Data string.

 

Am I completely missing something obvious? Or am I struggling with Azure Logic App limitations which will never work?
I did take a look at this article: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#split and for me it looks like it should be possible from within Logic Apps right?

 

Thanks a lot for your help!

Joost

Categories:
I have the same question (0)
  • jvdlinden Profile Picture
    329 on at

    Looks like I found a solution to the first issue already, provided by Sujith on this Forum:

    https://social.msdn.microsoft.com/Forums/SqlServer/en-US/2a814423-e947-40f5-bfc8-3b1f5e0a4f88/how-to-split-string-with-line-feed-n?forum=azurelogicapps

     

    It appears that Logic App handles it differently.

    After going into Code View, I noticed two times the \ character at the inputs row. I removed one and now it properly formats the data.

     

    Original code:

                "Table": {
                    "inputs""@split(outputs('CSV_Data'),'\\n')",
                    "runAfter": {
                        "CSV_Data": [
                            "Succeeded"
                        ]
                    },
                    "type""Compose"
                }
     
    Code afterwards:
     
                "Table": {
                    "inputs""@split(outputs('CSV_Data'),'\n')",
                    "runAfter": {
                        "CSV_Data": [
                            "Succeeded"
                        ]
                    },
                    "type""Compose"
                }
     
    Apart from that I am struggling with one more split function, how odd.
    Later on, the article suggests to perform this split:
     
    "
    let’s add a new Compose action that will grab the property value like ‘Microsoft’, or ‘usa’ ;
    "
     
    2020-02-01 00_17_47-Clipboard.png
    Code view from Logic App:
    "PropertyValue": {
    "inputs""@split(outputs('CurrentTableRow'), ',')[int(variables('indexProperty'))]",
    "runAfter": {},
    "type""Compose"
    },
     
    It looks like Logic App behaves differently here.
    I configured the expression exactly the same as in Power Automate, Logic App results in an error:
    2020-02-01 00_21_39-Logic app run - Microsoft Azure.png
     
    It is mixing up the data incorrectly as you may see in the error message.
     
    Would there be another trick in the code view to resolve here?
     
    Hope this story makes sense.
     
    Many thanks!
     
  • v-bacao-msft Profile Picture
    on at

     

    Hi @jvdlinden ,

     

    The same function, but may need to do different processing in different environments. Please consider submitting your question in this forum for a more detailed answer:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=azurelogicapps

     

    Best Regards,

  • jvdlinden Profile Picture
    329 on at

    Thank you @v-bacao-msft I have posted the question there as well.

  • Verified answer
    jvdlinden Profile Picture
    329 on at

    I learned that in Logic Apps this had to do with the Concurrency Control settings. After enabling it and putting it to value 1 (using the slider), the issue seemed resolved:

    For-Each-Concurrency.png

    Put this here for later reference for other users.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard