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

Button visible after condition

Hello;

 

After my condition , i would like change the button visibility (visible = true)

1) How can I do this ? 

 

2) In my filter i have a error with the lower function => "Delegation warning. The "Filter" part of this formula may not work correctly on large datasets"


How can improve this ? 

 

If(User().Email="XYZ@microsoft.com";
       SortByColumns(Filter('Home Working Test';
       StartsWith(Title; TextSearchBox1.Text)); "Title";
       If(SortDescending1; Descending; Ascending)

       & Button2.Visible=true;
);
      SortByColumns(Filter('Home Working Test'; Lower('Requester'.Email)=Lower(User().Email);
      StartsWith(Title; TextSearchBox1.Text)); "Title";
      If(SortDescending1; Descending; Ascending))
)

 

 

Thank you for your help ! Smiley Happy 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
mdevaney
Level 8

Re: Button visible after condition

@bansay 

 

Q1#  You must write the conditional statement within the Visible property of the button.  The visible property cannot be changed from another control.  Write this in the button's Visible property  

 

If(User().Email="XYZ@microsoft.com",true, false)

 

Q2# In my opinion, the best way is to ensure the emails are stored as lower case in the datasource.  All data coming into your database should be cleaned so that everything is stored as lower-case.  After all, its an email address, and email addresses should always be lower-case right?  Sorry that I could not offer a fancy function to solve the problem.  Writing complex formulas to handle delegation is hard so I think its just easier to maintain clean data upfront.

 

---

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."

 

Super User
Super User

Re: Button visible after condition

Hi,

 

2) on your App's OnStart, have it do:

Set(UserEmail = Lower(User().Email))

 

1) Set the Visible setting of your item = conditionMet, so in your case from the actual Button2 object, go to the Visible setting:

Visible= If(UserEmail=Lower("xyz@microsoft.com"))

 

Then change your formula to accomodate that:

 

 

If(UserEmail=Lower("XYZ@microsoft.com");
       SortByColumns(Filter('Home Working Test';
       StartsWith(Title; TextSearchBox1.Text)); "Title";
       If(SortDescending1; Descending; Ascending)
);
      SortByColumns(Filter('Home Working Test';Lower('Requester'.Email)=Lower(UserEmail);
      StartsWith(Title; TextSearchBox1.Text)); "Title";
      If(SortDescending1; Descending; Ascending))
)

 

I'm not sure whether the Lower function is delegable against SharePoint complex fields, so another workaround would be to create a text column that contains that email address, which will be delegable. You could also then have the App write the email address as Lower to the SharePoint list for any new items, which would negate the need to use Lower(RequesterEmail)

 

 




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!
2 REPLIES 2
Highlighted
mdevaney
Level 8

Re: Button visible after condition

@bansay 

 

Q1#  You must write the conditional statement within the Visible property of the button.  The visible property cannot be changed from another control.  Write this in the button's Visible property  

 

If(User().Email="XYZ@microsoft.com",true, false)

 

Q2# In my opinion, the best way is to ensure the emails are stored as lower case in the datasource.  All data coming into your database should be cleaned so that everything is stored as lower-case.  After all, its an email address, and email addresses should always be lower-case right?  Sorry that I could not offer a fancy function to solve the problem.  Writing complex formulas to handle delegation is hard so I think its just easier to maintain clean data upfront.

 

---

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."

 

Super User
Super User

Re: Button visible after condition

Hi,

 

2) on your App's OnStart, have it do:

Set(UserEmail = Lower(User().Email))

 

1) Set the Visible setting of your item = conditionMet, so in your case from the actual Button2 object, go to the Visible setting:

Visible= If(UserEmail=Lower("xyz@microsoft.com"))

 

Then change your formula to accomodate that:

 

 

If(UserEmail=Lower("XYZ@microsoft.com");
       SortByColumns(Filter('Home Working Test';
       StartsWith(Title; TextSearchBox1.Text)); "Title";
       If(SortDescending1; Descending; Ascending)
);
      SortByColumns(Filter('Home Working Test';Lower('Requester'.Email)=Lower(UserEmail);
      StartsWith(Title; TextSearchBox1.Text)); "Title";
      If(SortDescending1; Descending; Ascending))
)

 

I'm not sure whether the Lower function is delegable against SharePoint complex fields, so another workaround would be to create a text column that contains that email address, which will be delegable. You could also then have the App write the email address as Lower to the SharePoint list for any new items, which would negate the need to use Lower(RequesterEmail)

 

 




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 271 members 4,191 guests
Please welcome our newest community members: