cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FoDelement
Level 8

Collect gallery textlabel

Hello all,

 

I am trying to collect a textlabel from a gallery into a collection, but it does not seem to work. 

 

I have data being pulled from a sharepoint list being filtered into a gallery like so.

 

Items: LookUp(SoxControlOwners, Office365Users.MyProfileV2().mail = Onwer.Email).Controls

below is what it looks like.

1.jpg

However, I need to remove the - 9B part, so I change the label to show this.

 

Text: First(Split(ThisItem.Value, " -")).Result

2.jpg

when I do a clearcollect, using this, 

 

ClearCollect(colControls3, galControl.AllItems)

 

I get the following.


3.jpg

 

The problem with this is, I am trying to filter another gallery using this data.  Below is the gallery. 

 

4.jpg

You can see that the column does not have the "- 9B" at the end. The "labelControl" column has the data I need, but it's reading as a table, not text, so I can't filter using it.

 

5.jpg

 

6.jpg

 

Any one have any ideas? Or maybe an easier way to filter a gallery from a table? 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Collect gallery textlabel

@FoDelement 

Interesting problem you have there. I think you are very close to the solution.  Mind if I take a crack at it?

 

My assumptions are

  • You have a gallery called galControl
  • You want the field Value from galControl
  • The Value galControl from galControl looks like FLD-FXA-001 - 9B but you want FLD-FXA-001

 

ClearCollect(
    colControls3,
    ForAll(
        galControl.AllItems,
        {Result:First(Split(Value, "-")).Result}
    )
)

 

Your goal is to Filter Table1 by the values found in colControls3.  We created colControls3 as a single column table so we can use the IN operator to perform the filter.

 

Filter(Table1,'Control ID' in colControls3)

 

I think that will do the trick!  Let me know.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

 

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Collect gallery textlabel

@FoDelement 

Interesting problem you have there. I think you are very close to the solution.  Mind if I take a crack at it?

 

My assumptions are

  • You have a gallery called galControl
  • You want the field Value from galControl
  • The Value galControl from galControl looks like FLD-FXA-001 - 9B but you want FLD-FXA-001

 

ClearCollect(
    colControls3,
    ForAll(
        galControl.AllItems,
        {Result:First(Split(Value, "-")).Result}
    )
)

 

Your goal is to Filter Table1 by the values found in colControls3.  We created colControls3 as a single column table so we can use the IN operator to perform the filter.

 

Filter(Table1,'Control ID' in colControls3)

 

I think that will do the trick!  Let me know.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

 

View solution in original post

FoDelement
Level 8

Re: Collect gallery textlabel

Perfect!

 

I am just glad someone understood what I was talking about! 

 

I just had to update your code by adding that space before the "-" and it worked as I expected it the first time! Never thought about splitting the data duing the collection instead of before or after. 

 

Thanks again! 

 

ClearCollect(
    colControls3,
    ForAll(
        galControl.AllItems,
        {Result:First(Split(Value, " -")).Result}
    )
)

 

Super User
Super User

Re: Collect gallery textlabel

@FoDelement 

I definitely understood what you were talking about.  Thank you for providing so many screenshots along with your explanation of the problem.  This really made it easy to know exactly what output you were expecting!

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,091)