cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bansay
Level: Powered On

Verifie string in array + Refresh list after modify item

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 ! Smiley Happy 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Verifie string in array + Refresh list after modify item

Hi @bansay 

 

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!

View solution in original post

mdevaney
Level 8

Re: Verifie string in array + Refresh list after modify item

@bansay 

 

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.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Verifie string in array + Refresh list after modify item

Hi @bansay 

 

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!

View solution in original post

mdevaney
Level 8

Re: Verifie string in array + Refresh list after modify item

@bansay 

 

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.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 51 members 3,457 guests
Please welcome our newest community members: