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

Cells with space are taking as different lines in excel from power apps

Hi I have a gallery that needs to be download as CSV but i have a problem in that it is having one text field with multi line option so when I try to download it is going to next cells and entire  excel sheet is collapsing, how can I fix this ?

this is my excel sheet downloaded 

GAbraham_1-1602948292589.png

 

this is my text field with multi line option and if I enter text with spaces or enter like 2 lines it is going to different cells

GAbraham_2-1602948427506.png

 

this is my code :

Clear(unpaidarcol);
Set(
    unpaidarvar,
    ""
);
ForAll(
    Ageing_gallery.AllItems,
    Collect(
        unpaidarcol,
        {
            paraccnm: AcntName.Text,
            div: 'Dividion Name'.Text,
            terms: Terms.Text,
            cur: cur.Text,
            curr: Currency.Text,
            thirtydays: '0-30'.Text,
            sixtydays: '31-60'.Text,
            nintydays: '61-90'.Text,
            onetwentydays: '90-120'.Text,
            morethnonetwenty: '>120'.Text,
            tot: total.Text,
            lastpayrecdt: LastPaymentReceviedDate.Text,
            catg: Category.Text,
            ep: EP.Text,
            lastupddt: LastUpdatDate.Text,
            colnm: Collectornm.Text,
            cmnts: Trim(Comments.Text),
            nxtflwup: NextFollowUp.Text
        }
    )
);
UpdateContext(
    {
        currtotal: currtotal_lbl.Text,
        thirty: 0 - '0-30_total_lbl'.Text,
        sixty: '31-60_total_lbl'.Text,
        ninety: '61-90_total_lbl'.Text,
        hundredtwenty: 'Greater 90_total_lbl'.Text,
        over120: over120_total_lbl.Text,
        total: OverTotal.Text
    }
);
Set(
    unpaidarvar,
    "Parent Account, Division, Terms, Cur, Current, 1-30, 31-60, 61-90, 91-120, Over 120, Total, Last Payment Date, Category, EP, Last Updated Date, Collector Name, Comments, Next Follow-up Date" & Char(10) & Concat(
        unpaidarcol,
        paraccnm & "," & """" & div & """" & "," & """" & terms & """" & "," & cur & "," & """" &  curr & """" & "," & """" & thirtydays & """" & "," & """" & sixtydays & """" & "," & """" & nintydays & """" & "," & """" & onetwentydays & """" & "," & """" & morethnonetwenty & """" & "," & """" & tot & """" & "," & """" & lastpayrecdt & """" & "," & """" & catg & """" & "," & """" & ep & """" & "," & """" & lastupddt & """" & "," & """" & colnm & """" & ","  & """" & cmnts & """" & "," & """" & nxtflwup & """" & Char(10)
    ) & Char(10) & "Total" & "," & " " & "," & " " & "," & " " & "," & """" & currtotal & """" & "," & """" & thirty & """" & "," & """" & sixty & """" & "," & """" & ninety & """" & "," & """" & hundredtwenty & """" & "," & """" & over120 & """" & "," & """" & total & """" & ","
);

 

 
 Thank you in advance
Giftson Abraham
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @GAbraham ,

For this approach first, you need to send the Data to flow in JSON format. Like below  - 

//Collection Name - ExportCSV
Set(varFOrmattedJson,JSON(ExportCSV,JSONFormat.IndentFour));
Set(IsCompleted,ExportFileFromSP.Run(varFOrmattedJson,Text("ExportCSVFile_"&First(Split(varCurrentUser.Email, "@")).Result),"NA").completed);

 Now you can Parse the JSON Data in Flow.
After you can you Configure like below-highlighted Approach.

VijayTailor_0-1603097255714.png

Thanks,
Vijay

View solution in original post

3 REPLIES 3
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @GAbraham ,

Hope you are using ,Microsoft Flow for Export/File Create Purpose ,My Suggestion is You Can Formate your Column as  CSV Table.

For reference see the below Way..(i also faced the same issue in the past but after this approach, my outcomes is expected).
you can Add a Create CSV Table action and Formate Manulally like below - and Map the Correct column,

VijayTailor_0-1603004486767.png

You can see for my requirement, i am using Remarks (That is also multiline Text).
Thanks,

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay

How to pass collection as array to flow
Thank you!

Hi @GAbraham ,

For this approach first, you need to send the Data to flow in JSON format. Like below  - 

//Collection Name - ExportCSV
Set(varFOrmattedJson,JSON(ExportCSV,JSONFormat.IndentFour));
Set(IsCompleted,ExportFileFromSP.Run(varFOrmattedJson,Text("ExportCSVFile_"&First(Split(varCurrentUser.Email, "@")).Result),"NA").completed);

 Now you can Parse the JSON Data in Flow.
After you can you Configure like below-highlighted Approach.

VijayTailor_0-1603097255714.png

Thanks,
Vijay

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,514)