cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

OnStart-Variables not working

Hi all, 

 

i tried to reproduce the functionality of this tutorial, as i need to provide certain features to selected usergroups in my app.
i found similar code on several other posts in the net and gave it a try ...

https://medium.com/@brettjrandall/powerapps-hide-buttons-objects-based-on-office-365-group-membershi...

Now i came to 2 problems here:

 

1) the examples in the tutorial say, that the single commands are "divided" by semikolons ... when i do so only the first command works at all, everything else after the semikolon is ignored ..

2) using "&&" as "connector" shows me no errors but doesnt work either.

heres my code from the "OnStart" - Value

Set(CurrentUserUPN;'Office365-Benutzer'.MyProfile().UserPrincipalName)
&& ClearCollect(O365GroupMembers;'Office365-Gruppen'.ListGroupMembers("a958fc3f-6db5-4ef7-80f4-12342131232e").value)
&& Set(IsO365GroupMember;If(!IsBlank(LookUp(O365GroupMembers;userPrincipalName=CurrentUserUPN));true;false))

 

What am i doing wrong here `?

 

any ideas are strongly appreciated !

 

Kind regards and many thanks, 

 

markus 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@markus_poeschl 

Consider changing your OnStart Formula to the following:

Set(CurrentUserUPN;'Office365-Benutzer'.MyProfile().UserPrincipalName);;

ClearCollect(O365GroupMembers;'Office365-Gruppen'.ListGroupMembers("a958fc3f-6db5-4ef7-80f4-12342131232e").value);;

Set(IsO365GroupMember;!IsBlank(LookUp(O365GroupMembers;userPrincipalName=CurrentUserUPN)))

 

For your language settings, you need to separate lines with double semicolons ;;

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

7 REPLIES 7
Super User III
Super User III

@markus_poeschl 

Consider changing your OnStart Formula to the following:

Set(CurrentUserUPN;'Office365-Benutzer'.MyProfile().UserPrincipalName);;

ClearCollect(O365GroupMembers;'Office365-Gruppen'.ListGroupMembers("a958fc3f-6db5-4ef7-80f4-12342131232e").value);;

Set(IsO365GroupMember;!IsBlank(LookUp(O365GroupMembers;userPrincipalName=CurrentUserUPN)))

 

For your language settings, you need to separate lines with double semicolons ;;

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Edit: Removed incorrect Information for clarity. 

@z123 

Actually, not in that language setting.  All comas are represented with semicolons and semicolons for separators are replaced with double semicolons.  Please refer to this document for chaining and list separators.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes Woops, my mistake! Sorry!

@z123 No worries - it all gets jumbled in the head sometimes 😉

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hey Randy, thank you so much. That did the trick. 
Just for my convenience: whats the difference between ";" and ";;" .. as in every freaking "tutorial" there are only ";" mentioned when this peticular fx is listed ... 

Thanks you anyway !

@markus_poeschl 

That's great!

So, basically, any place you see the comas, you will use a semicolon. And any place you see a semicolon, you'll use a double semicolon.

But, the meaning is, semicolons for you separate parameters in a statement and double semicolons separate different functions (chained functions).  

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Top Solution Authors
Top Kudoed Authors
Users online (101,653)