cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

how to Concat selected toggles within a gallery

All,

I have been struggling to code the following scenario. I consider myself a newbie and my knowledge of powerapps is very limited. So, any hint is appreciated.

 

I followed the following posts - which helped me, however requirements chagned. 

 

https://powerusers.microsoft.com/t5/General-Discussion/How-to-get-value-of-selected-checkbox/m-p/246...

https://powerusers.microsoft.com/t5/General-Discussion/Checkbox-or-Toggle-edited-by-and-when/td-p/15...

 

I have a galllery that is coneccted to a SP table with 2 columns

Taks Name, Task Ticket. 

1)  I need to findout which toggles are true representing each task and Task Ticket (if i am using ForAll). How can I identify those toggled items (Toggles dont seem to have "name" property associated with them) and couldn't identify them.

2) how can I concenate them to make a single long string Outside of the gallery that can be displayed in a text box. I tried to use Collection in case, one of the toggles are unselected, however my collection keeps increasing. Couldn't get remove working.

 

Any hint / example is greatly appreciated. 

 

thanks

on OnSelect of the toggle within the gallery 

If( Toggle4.Value = true,
Collect(CheckCollection, 
{
    TaskName: ThisItem.Name
}
))

I also have 

ForAll(
         Filter(Gallery1.AllItems, Toggle4.Value = true),
         Collect(CheckCollection,
                    'Task Name'
         )
);

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: how to Concat selected toggles within a gallery

@Anonymous

Ok, so you mention two fields/columns - Task Name and Task Ticket

I am going to assume from that the toggles are not part of any field or column of importance.

Also, you only mentioned a single string for all the items checked - I am going to assume a comma separated list of Task Name - Task Ticket

Also assuming that Task Ticket is a text column.

 

With all those assumptions, what you are looking for is this formula:

Concat(Filter(yourGalleryName.AllItems, yourToggleName.Value), TaskName & " - " & TaskTicket & ", ")

Substitute your control names and your Column names in the red items above.

 

That should give you the string of all selected (checked) items in your Gallery.

 

Hope that helps.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: how to Concat selected toggles within a gallery

@Anonymous 

Can you explain what you are referring to with the toggles?

You mentioned you had two columns - Task Name and Task Ticket

So what is the toggle and what is it tied to?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Anonymous
Not applicable

Re: how to Concat selected toggles within a gallery

Hi Randy,

 

Thanks for replying. basically it is a set of tasks that have to be tested every morning. If one of them is failed, we need to toggle the corresponding toggle control to failed / false. similar to the first link except with toggle instead of checkboxes. How can I show what is selected outside gallery using label and if unselected, drop it from the selected list / label value. 

do I make any sense? 

Guldf_Man

 

Toggle.jpg

Highlighted
Super User
Super User

Re: how to Concat selected toggles within a gallery

@Anonymous

Ok, so you mention two fields/columns - Task Name and Task Ticket

I am going to assume from that the toggles are not part of any field or column of importance.

Also, you only mentioned a single string for all the items checked - I am going to assume a comma separated list of Task Name - Task Ticket

Also assuming that Task Ticket is a text column.

 

With all those assumptions, what you are looking for is this formula:

Concat(Filter(yourGalleryName.AllItems, yourToggleName.Value), TaskName & " - " & TaskTicket & ", ")

Substitute your control names and your Column names in the red items above.

 

That should give you the string of all selected (checked) items in your Gallery.

 

Hope that helps.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: how to Concat selected toggles within a gallery

Thank you Randy. continuing with my dev till another issue pops....

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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