cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Post Patron
Post Patron

Header Sequence - Canvas App

Team,

I am trying to realign the header in desired format but i could not, Formula follows,

Test1.Run(User().Email, 
  JSON(With(
      {TheTable: 
	    ShowColumns(
			AddColumns(
			  GroupBy(
				Filter(
					ShowColumns(
					  Dailyinventory, "crf99_sno", "crf99_materialdesc", 
					  "crf99_materialno", "createdon", 
					  "crf99_bbd", "crf99_qty"
					), 
					DateDiff(createdon,Today(),Days) = 0
				), "crf99_materialdesc", "NewGroup"
			  ), 
			  "Materialno", 
			  First(NewGroup).crf99_materialno, 
			  "Qty", 
			  Sum(NewGroup, crf99_qty), 
			  "Created On", 
			  Last(NewGroup).createdon, 
			  "bbd", 
			  Last(NewGroup).crf99_bbd, 
			  "Sap-Stock", 
			  LookUp(
				sapstock, 
				material = First(NewGroup).crf99_materialno, 
				unrestrictedStock
			  )
			), 
            "Materialno",
            "crf99_materialdesc", 
            "Qty", 
			"Sap-Stock",
			"Created On", 
			"bbd"
				
		)
	  },
      
	  ForAll(Sequence(CountRows(TheTable)), Patch(Last(FirstN(TheTable, Value)),{Sno : Value}))
    )
  )
)

 

Current result, 

AVTS_0-1622905194772.png

 

Expected

AVTS_1-1622905264642.png

 

Can you help me with expected format

7 REPLIES 7
Pstork1
Dual Super User III
Dual Super User III

What kind of control are you displaying the records in?  A data table or a gallery?  The order of the columns in those is controlled by the layout of the fields in the control, not the order in the data source.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

The formula is attached in to the button click , layout is similar to Data Table .

Pstork1
Dual Super User III
Dual Super User III

I understand that the formula runs on a button click.  But how are the results displayed?  The display controls are normally how you specify the layout.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Button click trigger the flow with csv attachement to email. Current layout is mentioned in the main topic

Pstork1
Dual Super User III
Dual Super User III

Can you provide screenshots of the flow?  You should be able to use the Data Select Command to re-order the columns prior to creating the CSV.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Sure, Attached.

AVTS_0-1622921265681.pngAVTS_1-1622921294489.png

 

Pstork1
Dual Super User III
Dual Super User III

The easiest way to control the labels and order of the headers in the CSV would be to change the Columns dropdown in the Create CSV action from Automatic to Custom.  Once you do that you can specify the headers you want in order and the values from the array that you want in each column.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,007)