cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

@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.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@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.
Check out my PowerApps Videos too!
Anonymous
Not applicable

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

@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.
Check out my PowerApps Videos too!

View solution in original post

Anonymous
Not applicable

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (95,956)