cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FoDelement
Continued Contributor
Continued Contributor

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
mdevaney
Super User III
Super User III

@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
mdevaney
Super User III
Super User III

@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
Continued Contributor
Continued Contributor

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}
    )
)

 

@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
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (23,668)