web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Verifie string in arra...
Power Apps
Answered

Verifie string in array + Refresh list after modify item

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello;

 

# Q1 : How is it possible to verify if an e-mail (String) is in my array UserAdmin ?

 

The array  : 

Set(UserAdmin;["XYZ@microdk.onmicrosoft.com";"Test@microdk.onmicrosoft.com"]) 

 

# Q2 : How is it possible to refresh a list after a modification ? 

My code verify if a checkbok is check in a gallery with items, and if it checked the item's property is modified

 

The code on OnSelect of a button  : 

 

ForAll(
Filter(BrowseGallery1.AllItems; Checkbox2.Value = true);
Patch('List1'; { ID: ID }; { Status_Request: { Value: "Approved" }}))
//Refrech('List1')

 

Thank you for your help ! 🙂 

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    To check if a string exist in a array, you can use the expression:
     
    If("XYZ@microdk.onmicrosoft.com" in UserAdmin.Value;"Exist";"DonotExist")
     
    Also, to refresh the record once it is saved:
     
    If you wish to update only once after all the records are patched,
    ForAll(
    Filter(BrowseGallery1.AllItems; Checkbox2.Value = true);
    Patch('List1'; { ID: ID }; { Status_Request: { Value: "Approved" }}));;Refresh('List1')
     
    If you want to refresh after every item:
    ForAll(
    Filter(BrowseGallery1.AllItems; Checkbox2.Value = true);
    Patch('List1'; { ID: ID }; { Status_Request: { Value: "Approved" }});;Refresh('List1'))
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

     

    Q1.  First, Set the array variable just as you have already done.

     

    Set(UserAdmin,["XYZ@microdk.onmicrosoft.com","Test@microdk.onmicrosoft.com"]);

     

    Then you can check if a user is Admin by doing something like this.

     

    If("XYZ@microdk.onmicrosoft.com" in UserAdmin, true, false)

    Q2.  From what I can tell you have the right idea.  What type of datasource are you using?  Only managed connections can be refreshed (e.g. you can't refresh a collection).  Are you using a Sharepoint List?  It would be refreshed using the code below.  Let me know more details if it doesn't work.

     

    Refresh(List1)

     

    Also, you might have mispelled Refresh as Refrech and that might be the problem

     

     

    ---

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard