cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
infinitepp
Helper I
Helper I

Show some records in gallery

Hi, In this picture below is the collection that has column: license_number, and I do not want to show the record has "-" in the gallery. 

This is the code that I've tried.

 

I am looking forward to hearing your feedback and advice 

Thank you 

 

infinitepp_0-1619615580685.png

 

ForAll(
    tbl_hist_insurance,
    If(
        license_number = "-",
        Hidden
    );
    Collect(
        col_insuranceData,
        {
            SaleCode: SaleCode,
            license_number: license_number,
            sale_TName: LookUp(
                tbl_mas_saleagents,
                Title = tbl_hist_insurance[@SaleCode]
            ).sale_TName,
            sale_FName: LookUp(
                tbl_mas_saleagents,
                Title = tbl_hist_insurance[@SaleCode]
            ).sale_FName,
            sale_LName: LookUp(
                tbl_mas_saleagents,
                Title = tbl_hist_insurance[@SaleCode]
            ).sale_LName,
            license_name: LookUp(
                tbl_mas_license,
                licenseCode = tbl_hist_insurance[@licenseCode]
            ).license_name
        }
    )
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
praeclarus
Frequent Visitor

if you mean you want to hide the record has "-" in column license_number. 

Maybe you can try this before ForAll function.

 Remove(
    tbl_hist_insurance,
    First(
        Filter(
            tbl_hist_insurance,
            license_number = "-"
        )
    )
);

 

View solution in original post

6 REPLIES 6
proxyprochy
Resolver I
Resolver I

The easiest way is:

 

If(license_name = "-", "")

 

= if licence name = "-", then it's replaced by empty string.

 

Hope it works!

proxyprochy
Resolver I
Resolver I

Or if you want to hide the record completely from the gallery,

 

just specify in the LookUp function that you don't want records that contains "-" in the column license_number..

 

I'm not sure what your source looks like, but i guess you got the point:

 

LookUp(
tbl_mas_license,
licenseCode = tbl_hist_insurance[@licenseCode] && tbl_hist_insurance[@licenseCode] != "-")

Yes I'd like to hide the record completely and This is error: Expectation Operator, I'm not sure what's my mistake.

infinitepp_1-1619617514677.png

 

 

you have to define what it doesn't equal to,

 

for example:

LookUp(MyColl, Column1.Value = stringA && Column1.Value != stringB)

praeclarus
Frequent Visitor

if you mean you want to hide the record has "-" in column license_number. 

Maybe you can try this before ForAll function.

 Remove(
    tbl_hist_insurance,
    First(
        Filter(
            tbl_hist_insurance,
            license_number = "-"
        )
    )
);

 

View solution in original post

Thanks very much for your help! You are a magician.😘  messageImage_1619689168150.jpg

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,838)