cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmoorjmalani
Advocate III
Advocate III

Setting visibility of Controls through OnView of SharePointIntegration or OnVisible of screen not triggering for View Form

Hello,

 

I am trying to set visibility of several controls on the screen using the following condition, which is working fine for Edit and New form modes but when the form is opened in View mode, the value set in the variable is not coming into effect when the form is loaded at first, it works when the form is opened the second time.

 

I first wrote my condition in OnVisible() of the Screen, I also wrote an explicit call to Navigate to the Screen in OnView of SharePointIntegration to make sure that the OnVisible() was getting called, following is what I wrote on OnVisible()

If(DVEntity.Selected.Value ="Classic" && (drpTypeOfTeam.Selected.'Type of Team' = "Proposal") && Lower(drpDept.Selected.Title) in Lower(InternationDepartments), UpdateContext({ShowIDDGBDUControls:true}), UpdateContext({ShowIDDGBDUControls:false}));
If(DVEntity.Selected.Value ="Classic" && drpTypeOfTeam.Selected.'Type of Team' = "Proposal" && Lower(drpDept.Selected.Title) in Lower(DomesticDepartments), UpdateContext({ShowDomesticGBDUControls:true}),UpdateContext({ShowDomesticGBDUControls:false}));

And this is what i have in OnView() 

Refresh('Teams Creation Form');
ViewForm(TeamRequestForm);
Navigate(FormScreen1,Transition.None);

I also tried moving the condition to OnView() instead and created Global Variable using Set() but the result was same.

 

This is what i have in Visible of one of the controls,

(ShowDomesticGBDUControls || ShowIDDGBDUControls)

 

Is there something that i am missing? again this is only happening when the form is opened in View mode for the first time for each item.
Any help is appreciated! 

Thank you!

Deepa Moorjmalani

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
dmoorjmalani
Advocate III
Advocate III

Hi @WarrenBelz ,

 

Thank you for your input! the problem turned out to be that I was referring to the controls in the condition, which didn't have values in the first load, i looked up the record and replaced the control values with the record value and it started working.

Thank you again!

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @dmoorjmalani ,

Welcome to Variables and Integrated forms . . . I can never get these triggers (OnVisible and App OnStart) to trigger  consistently on a subsequent record selection without refreshing the SharePoint list, so my users know to simply do that. The problem I believe is that the form is already "open" and helpfully (in the eyes of the app) simply displays the next record you select. Refreshing SP seems to reset all of this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

dmoorjmalani
Advocate III
Advocate III

Hi @WarrenBelz ,

 

Thank you for your input! the problem turned out to be that I was referring to the controls in the condition, which didn't have values in the first load, i looked up the record and replaced the control values with the record value and it started working.

Thank you again!

View solution in original post

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 (3,319)