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

Is it possible to get all column names from a sharepoint list?

As topic, is there a way to show all column name from a sharepoint list? maybe a function that can generate a collection that contain all column name from a SP list?

11 REPLIES 11
3tsolutions
Advocate I
Advocate I
AlexinEdmonton
Frequent Visitor

I'd recommend using Power Automate to get the column names. I got the idea how to solve using @3tsolutions 's post here: https://powerusers.microsoft.com/t5/Building-Power-Apps/How-get-columns-name-from-sharepoint-list/m-...

 

Here's the gist:

1. Get Items from your list (Top Count = 1).

2. Create CSV table (Columns = Automatic).

3. Create Variable that is a string of the headers.

4. Create an Array variable from the string of headers:

AlexinEdmonton_3-1649368269223.png

Here are the expressions you'll need:
Compose Newline: decodeUriComponent('%0A')
Headers: first(split(body('Create_CSV_table'),outputs('Compose_Newline')))
Column Names: split(variables('headers'),',')
 

When run will give you this output that contains all the column titles. You can copy from the output and paste into your formula (clean the list as needed)

AlexinEdmonton_2-1649368179665.png

Paste into PowerApps with column names cleaned as required (I had to remove a few that were causing errors and some others I didn't want):

 

AlexinEdmonton_4-1649368858857.png

 

Takes a few minutes to set up but is worth it to get the column names especially if you need to write out (for e.g.) 50 columns.

 

Cheers,

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,377)