cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Xpholio
Frequent Visitor

Getting a syntax error when trying to search through Sharepoint list

Hi there,

 

So I have a SharePoint list called 'Access_Control' which consists of an email and three other fields (TECL, EIECL, Satellite_ECL) as you can see below

 

Dummy ECL.PNG

 

I then have a drop-down list which stores the current drop-down option in a variable called ECL_Option.

Finally I have a gallery. I want the gallery's visibility to depend on the drop-down list option and the Access_Control database. If the drop-down option is Transpower, the User's email is in the database and TECL is true then the gallery should be visible otherwise the gallery shouldn't be visible.

 

My code so far is as follows:
If(ECL_Option="Transpower",
ForAll(Access_Control,
If(Title=User().Email, If( TECL="Yes", true, false)), false))

 

Here is a photo of the Power Apps screen I am working on:

 

Screen.PNG

I just am really struggling with the syntax of this language constantly maybe it is because I am use to object-orientated programming. As well as answering this question if anyone has any possible resources to learn the syntax better and kind of linking/nesting things together smoothly that'd be great. Cheers!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @Xpholio ,

I will give you what I think is the solution and then explain it

ECL_Option="Transpower" &&
Countrows(
   Filter(
      Access_Control,
      Title=User().Email &&
      TECL
   )
)>0

Firstly for a Boolean Variable such as Visible, you simply make a statement that can only be true or false and that that translates directly into the Visible property. Secondly, I am assuming that TCL is also a Yes/No field (which is actually true/false - if not use TCL="Yes" in the above.

So the statement says 

  • IF ECL_Option is Transpower AND
  • in the Access_Control list, IF there are any records with
    • BOTH Title equalling the user's email AND
    • TECL being true,
  • then make the control Visible.

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.

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User III
Super User III

Hi @Xpholio ,

I will give you what I think is the solution and then explain it

ECL_Option="Transpower" &&
Countrows(
   Filter(
      Access_Control,
      Title=User().Email &&
      TECL
   )
)>0

Firstly for a Boolean Variable such as Visible, you simply make a statement that can only be true or false and that that translates directly into the Visible property. Secondly, I am assuming that TCL is also a Yes/No field (which is actually true/false - if not use TCL="Yes" in the above.

So the statement says 

  • IF ECL_Option is Transpower AND
  • in the Access_Control list, IF there are any records with
    • BOTH Title equalling the user's email AND
    • TECL being true,
  • then make the control Visible.

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.

 

View solution in original post

WarrenBelz
Super User III
Super User III

Hi @Xpholio ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Awesome yes it works perfectly. Thank you for providing an explanation too

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (27,676)