cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Split function different behavior Flow vs Logic App

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... 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#s... and for me it looks like it should be possible from within Logic Apps right?

 

Thanks a lot for your help!

Joost

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate V
Advocate V

Re: Split function different behavior Flow vs Logic App

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.

View solution in original post

4 REPLIES 4
Highlighted
Advocate V
Advocate V

Re: Split function different behavior Flow vs Logic App

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...

 

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!
 
Highlighted
Community Support
Community Support

Re: Split function different behavior Flow vs Logic App

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate V
Advocate V

Re: Split function different behavior Flow vs Logic App

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

Highlighted
Advocate V
Advocate V

Re: Split function different behavior Flow vs Logic App

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.

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Kudoed Authors
Users online (6,986)