cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kastore
Resolver II
Resolver II

Add new line to variable and the final .txt file

Hello everyone,

 

we are currently trying to process a order form into a new file format that can be uploaded to our ordering-program. I currently get a file that looks good on MAC but the Notepad (remote pc) shows just ONE HUGE line and not 28 separate ones.

 

 

The required format is .txt file and the values need to be ONE LINE per order. So the issue is between Step 6 and Step 7. 

 

The flow currently works like this:

1) Trigger: When file is uploaded

2+3) Create variable to be used later on (e.g. Umbruch [new line] - is just the "enter key pressed once" and SHOULD get added to the final variable (concat....)

4+5) Get the values from the Excel sheet (different sheet everytime, so it is analyzed via JSON)

6) (apply to each) - Get the values from (5) and string them up after each other -> EACH "apply each" is one order. 

7) String them together 

8...) do some magic and add them into a .txt file (create file "Name" with content from the Variable (7)) and then delete the order from so it doesn't linger around (not shown here)

 

Bildschirmfoto 2022-11-28 um 15.02.44.png

1 ACCEPTED SOLUTION

Accepted Solutions
Kastore
Resolver II
Resolver II

I have added the above mentioned code 

decodeUriComponent('%0D%0A')

 

into the "apply to each" section:

Bildschirmfoto 2022-11-28 um 16.11.42.png

 

Now the txt. file has "real" new lines that are also understood by Microsoft and therefore can be used by the program we try to import the file to

View solution in original post

4 REPLIES 4
grantjenkins
Community Champion
Community Champion

Instead of concatenating the new line via your variable can you use the following expression instead. This should give you a new line and carriage return.

 

decodeUriComponent('%0D%0A')

  



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

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.
Kastore
Resolver II
Resolver II

At what point would i need to add that info? I have seen the post as well but i just couldnt figure that part out

 

I currently need the variable (at least from my understanding of how this works) to add all the strings into one file. So what is why i worked with the variables

Kastore
Resolver II
Resolver II

I have added the above mentioned code 

decodeUriComponent('%0D%0A')

 

into the "apply to each" section:

Bildschirmfoto 2022-11-28 um 16.11.42.png

 

Now the txt. file has "real" new lines that are also understood by Microsoft and therefore can be used by the program we try to import the file to

So, is it working correctly for you now?



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

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,266)