cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vibuc
Level: Powered On

Write Gallery.AllItems Value into Label or Textbox.

Hi folks,

 

I have a sharepoint list including employee data from the AD like Name, Email etc.

Entries from this list get filtered in the PowerApp and shown in a PowerApp gallery. (E.g. Steven Miller; Chicago; Head of Marketing)

 

I want to create a button which fills a textbox with all email addresses from this pre-filtered gallery (to create some kind of topic specific mail distribution list)

 

The textbox is set to show a variable ('var1'), therefore I thought to store all email addresses as a long string into this variable.

 

I basically need a loop like the following one, but have no idea how the syntax in PowerApps would look like:

For each item in gallery

    Var1 = Var1 + "; " + row.value

 

Is there an easy way to solve this?

 

1 ACCEPTED SOLUTION

Accepted Solutions
vibuc
Level: Powered On

Re: Write Gallery.AllItems Value into Label or Textbox.

Thank you, this hint basically led me to my solution. I got stuck searching for a solution using "ForAll", but this is not necessary.

I just save the gallery into a collection and display it via concat.


Button:

Clear(Collection1);;
Collect(Collection1; Gallery1.AllItems)

Textfield:

Concat(Collection; 'Employee Name'.Email & "; ")

 

Thanks for the support.

View solution in original post

2 REPLIES 2
Edwin-Abdalian
Level 10

Re: Write Gallery.AllItems Value into Label or Textbox.

Have you tried the Concat(not Concatenate) function? It’s built for that, it will go through the items in your list and separate them by a character that you specify.
Check this out
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concatenate#descript...
vibuc
Level: Powered On

Re: Write Gallery.AllItems Value into Label or Textbox.

Thank you, this hint basically led me to my solution. I got stuck searching for a solution using "ForAll", but this is not necessary.

I just save the gallery into a collection and display it via concat.


Button:

Clear(Collection1);;
Collect(Collection1; Gallery1.AllItems)

Textfield:

Concat(Collection; 'Employee Name'.Email & "; ")

 

Thanks for the support.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,019)