How to split gallery items in Power Apps

Never wondered how to split gallery items in Power Apps? This blog describes how you can split a single gallery into multiple items in a secondary gallery. To be specific, the multiple selected items from the combo box control in the primary collection are split into multiple items in a secondary collection.

Consider a request app to request devices such as a desktop, laptop, tablet or phone. For each device you have the option to select accessories and quantity. In order to make it user-friendly for the end-user you are using the Combo box control for accessories and allowing the multiple selection property. However, you want to want to take that single item and split it into multiple items and save it in a secondary gallery. The total count of the multiple items depends on how many accessories were selected.

The app comprises of three collections, the primary, secondary and a temporary collection. The temporary collection is first used to save the split accessory items only and then using that collection the secondary collection is created.

In addition, we are using the DateAdd and Now functions to create the ID which is used to build relationship.

Formulas

Here is a screenshot of the Save button. The button does four things:

  1. It first creates the ID value using Now and DateAdd and saves it to a variable
  2. Saves the data in the primary collections
  3. Splits the value from the Accessories and saves it as a comma separated value in a label. Data from that label is then split into a temporary collection.
  4. Takes values from the temporary collection and creates a secondary collection.

Split Gallery items in PowerApps

The process

This video walks you through the entire process.

Conclusion

This is how you split gallery items in Power Apps. By splitting the data in Power Apps, you have already made it easier for future reporting purposes using Power BI.

Make sure to read my previous blog posts about Power Apps!

***

Do you want to see our Valo digital workplace solutions with your own eyes? Book a demo with us and we’d be happy to show you!

BOOK A DEMO

Schedule your free demo!

Want to make your life much easier and work more effective? Yes! We’re more than happy to schedule a demo with you! Just contact us and we’ll get back to you.

We keep your information safe. Read more from our Privacy Policy.

Subscribe to our Newsletter

Get our news delivered right into your inbox. We won’t spam, promise!

We keep your information safe. Read more from our Privacy Policy.