Hi people.
Well, getting to the point, I'm having trouble when I try to load information contained in a Sharepoint list into a Power Apps collection. This is the list with an example item:
This is the code I'm using in the App object on the OnStart function:
ClearCollect(colExternos; 'Form Template')
And this is the output I'm getting:
If anyone can give me any idea why this might be happening, before I blow my head off XD, it would be very helpful.
Thanks for the help and regards
Update. It worked perfectly using the following syntax:
ClearCollect(colExternos; ShowColumns('Form Template';"Title"; "ColumnType"; "Required"; "Choises"))
I think the general appearance of the table is due to the formatting change they did.
Thanks and regards
Particularly, regarding the function "ShowColumns" when I use it, the system tells me that "colExternos" is not a valid name and that is not recognized. Thanks anyway 😉
I understand. But still, Power Apps keeps showing me the table in a messy way. At first, the names of the columns do not appear. Only when you double click do they appear. Nor does it allow me to navigate laterally through the table (in case it called all the columns that I already saw, which is not the best option, but the same). Do you have any idea why it might be happening? and how can it be configured? Thanks and regards.
What you are seeing is the return of every column the SP List has currently. Even if you have a custom view set up on the SP List it will return all columns/fields. You can request to only grab certain columns from SP and then this collection will look much more 'clean' and prettified like you are wanting.
ClearCollect(myLocalCollectionName, ShowColumns(mySPListName, "Column1", "Column2","Column3"))
This will take everything in mySPListName and move the data in the columns listed to a local collection called myLocalCollectionName. Your code would look something like this:
ClearCollect(colExternos; ShowColumns('Form Template', "Titulo","ColumnType","Required","Choices","AgregarColumna"))
Also while I am here I would suggest starting to keep spaces out of your column names in SP. Generally accepted rule is to not use spaces as they then require single quotes everywhere in your code in Power Apps and it causes a headache. So instead of "Column Type" just use "ColumnType". Many people dont like this becuase the words are together in forms but you can simple retype the form field titles instead of using Parent.Default.
What information specifically are you trying to load into your collection? It looks about right, you're just getting EVERYTHING in the SharePoint list.
Try this to view your data in another way (you'll need to enable improved data table control)
Insert > Table > Edit fields > Select your desired columns.
I find that an easier way to review what I'm dealing with vis the view you have a screenshot of.
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional