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

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
Highlighted

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
Highlighted
Solution Supplier
Solution Supplier

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...
Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,680)