cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gazbeer
Helper III
Helper III

Problem with Collection

Hi all,

 

I'm hoping someone can help with what should be an easy fix!

 

My collection isn't getting all the data from a gallery when selected, it is only populating 2 columns instead of 5. I am trying to split strings then save the broken down string to a table in a collection.

 

My formula is 

 

ForAll(Split(GalleryPicker_1.Selected.VehiclesUsed,","),Collect(Coll_Vehicles,{VehiclesUsed: Result}));

ForAll(Split(GalleryPicker_1.Selected.RunwayAndBellmouthsTreated,","),Collect(Coll_Vehicles,{RunwayAndBellmouths: Result}));

ForAll(Split(GalleryPicker_1.Selected.TaxiwaysTreated,","),Collect(Coll_Vehicles,{Taxiways: Result}));

ForAll(Split(GalleryPicker_1.Selected.BellmouthsTreated,","),Collect(Coll_Vehicles,{Bellmouths: Result}));

ForAll(Split(GalleryPicker_1.Selected.StandsTreated,","),Collect(Coll_Vehicles,{Stands: Result}));

 

 

Only 2 columns are populating from the 5 lines of code. Can anyone advise where I'm going wrong please?

 

Many Thanks

 

Gary

2 REPLIES 2
PTBBSolutions
Solution Supplier
Solution Supplier

Hi @Gazbeer ,

 

Can you send a screenshot of how you collections looks like (the 2 columns) + sample data from the gallery?

CNT
Super User
Super User

@Gazbeer Try this,

ForAll(Sequence(CountRows(Split(GalleryPicker_1.Selected.VehiclesUsed,","))),
	Patch(Coll_Vehicles, Defaults(Coll_Vehicles),
		{	VehiclesUsed: Last(FirstN(Split(GalleryPicker_1.Selected.VehiclesUsed,","), Value)).Result,
			RunwayAndBellmouths: Last(FirstN(Split(GalleryPicker_1.Selected.RunwayAndBellmouthsTreated,","), Value)).Result,
			Taxiways: Last(FirstN(Split(GalleryPicker_1.Selected.TaxiwaysTreated,","), Value)).Result,
			Bellmouths: Last(FirstN(Split(GalleryPicker_1.Selected.BellmouthsTreated,","), Value)).Result,
			Stands: Last(FirstN(Split(GalleryPicker_1.Selected.StandsTreated,","), Value)).Result,
		}
	)
)

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

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

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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