cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bbsin
Post Prodigy
Post Prodigy

how to patch with one button for the item select in gallery and also who error message in search box??? help please. thanks

Hi

 

I have a gallery of item that need to be update, I don't want the update button in each item.  How to have one outside the gallery and only patch the select item when user search and appeared in Gallery?  the item can show one or many.

 

 1.PNG

 

2)  I have a text box message for error if they search the wrong number that does not exist in the SP list.  How to make it appear and disappear when they key in the wrong number?

Do I use visible on error text box as below? as it doesn't wrong

visible = If(Or(IsBlank(Searchbox),IsBlank(LookUp('list', StartsWith(updatenumber,Searchox.Text))), true, false)

 

 

kindly advise. thanks 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Community Champion
Community Champion

Hi @bbsin ,

One question at a time - otherwise we'll get way too confused 😊

 

First - let's deal with your error message when the result is empty. 

There are usually many different ways to achieve the same result in Power Apps, so this is sometimes a question of preference.  Personally, I would prefer to do as few queries back to the source as possible - so in this respect we can use your Gallery to see if the result was successful or not - instead of repeating the query with the label and testing the result again.

Set your error label Visible: property to 

 

!IsBlank(InvQuery) && IsEmpty(Gallery.AllItems)

 

 

This will rely on the Gallery items: call and save you running another call back to the source - but it might also show the message while the query is still being run, which might not be ideal. 

In that case, you might be forced to duplicate your Items: query on your label Visible: property, but test whether it's empty - so your label Visible: property might then just be;

 

IsEmpty(Filter('HRFA Procurement List_2021 (Invoices)',StartsWith(Description,InvQuery)))

 

 

Lastly, yes you can use the Search() function as @Ashwin7104 mentioned to check multiple columns for a value, however as he also pointed out, this function is not delegable.  This means, you can't rely on it for accuracy if your source contains more than 500 records (or whatever you set your return record limit to if you changed the default).

For this you would be better off using an OR operator on your filter;

 

Filter( 'HRFA Procurement List_2021 (Invoices)', 
  StartsWith(Description,InvQuery) || 
  StartsWith(PO,InvQuery) 
)

 

 

Hope this helps,

 

RT 

View solution in original post

11 REPLIES 11
RusselThomas
Community Champion
Community Champion

Hi @bbsin ,

There are a couple of features of Galleries that are quite cool - one of which is that they behave like collections - meaning you can filter them and access their records just like a collection.  Not only that, but you can also access their child control properties as fields.

 

1) If you place the update button outside the gallery, you can set it to patch all updated items using the ForAll() function.

Button OnSelect:

 

ForAll(
     Filter(Gallery.AllItems, !IsBlank(TextInput1.Text)), 
     Patch(Source, ThisRecord, {PONumberColumn: ThisRecord.TextInput.Text})
)

 

 

2) If your gallery is the result of PO numbers searched and found, then it might be faster and easier to just pop up the error message if the gallery is empty instead of doing another lookup to the same source.

Error Label Visible: 

 

IsEmpty(Gallery1.AllItems)

 

 

Hope this helps,

 

RT

Hi @RusselThomas 

 

The one button to patch all is working . Thanks

 

But the error text box not working - I cannot get it to pop when search box didn't match with PO number 

 

eg SP list only have 1223, 1234 but use input 1221.. how to show please entre correct number as there is no such number?  How to ensure the search box matched the list number? Thanks

 

 

Also one item - how to disable edit box for item that has been update and moved to the bottom , new records should be at the top instead.  thanks

 

my sample its not showing the error messag when I put wrong description

1.PNG


Visble - If(IsBlank(SearchBox),IsBlank(LookUp('list', StartsWith(Description,SearchDesInput.Text))), true, false)

 

What did I do wrong?   Thanks

 

Do advise thanks.

 

Hi @bbsin ,

 

Trying using search function since it would match the search string in the specified column and also its case-insensitive compared to Lookup.

Visible - If(!IsBlank(SearchBox), If(CountRows(Search('list', SearchDesInput.Text,"Description")) >0, true, false))

Thank you.

Hi @Ashwin7104 

 

There's error, what is wrong ?  Do advise Thanks.

 

2.PNG1.PNG

Hi @bbsin ,

 

Apologies, Kindly refer to my edited code above. Also note that search is not Delegable. In case, if you want to search more than 100 records use combination of filter and StartsWith.

https://powerusers.microsoft.com/t5/Building-Power-Apps/delegation-warning-the-search-part-of-this-f...

Hi @bbsin ,

 

What is the Items: property of your Gallery set to please?


Kind regards,


RT

HI RusselThomas, 

 

Sure, I created a variable as InvQuery -is search description 

 

item - Filter('list (Invoices)',StartsWith(Description,InvQuery))

 

Is it possible to search description and POnumber either one if the user input into the search box? 

 

Thanks

RusselThomas
Community Champion
Community Champion

Hi @bbsin ,

One question at a time - otherwise we'll get way too confused 😊

 

First - let's deal with your error message when the result is empty. 

There are usually many different ways to achieve the same result in Power Apps, so this is sometimes a question of preference.  Personally, I would prefer to do as few queries back to the source as possible - so in this respect we can use your Gallery to see if the result was successful or not - instead of repeating the query with the label and testing the result again.

Set your error label Visible: property to 

 

!IsBlank(InvQuery) && IsEmpty(Gallery.AllItems)

 

 

This will rely on the Gallery items: call and save you running another call back to the source - but it might also show the message while the query is still being run, which might not be ideal. 

In that case, you might be forced to duplicate your Items: query on your label Visible: property, but test whether it's empty - so your label Visible: property might then just be;

 

IsEmpty(Filter('HRFA Procurement List_2021 (Invoices)',StartsWith(Description,InvQuery)))

 

 

Lastly, yes you can use the Search() function as @Ashwin7104 mentioned to check multiple columns for a value, however as he also pointed out, this function is not delegable.  This means, you can't rely on it for accuracy if your source contains more than 500 records (or whatever you set your return record limit to if you changed the default).

For this you would be better off using an OR operator on your filter;

 

Filter( 'HRFA Procurement List_2021 (Invoices)', 
  StartsWith(Description,InvQuery) || 
  StartsWith(PO,InvQuery) 
)

 

 

Hope this helps,

 

RT 

@RusselThomas

 

You are a great help. it works.. Appreciated

 

Two questions

1) after I click off the search box text , the gallery still show the last record how to make it empty?

1.PNG

and 

2) how to show the latest record and push the old record down?  Thanks.  

As of now, the list of gallery appeared all with completed one too.

 

Regards

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages