cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
markus_poeschl
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
RandyHayes
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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

7 REPLIES 7
RandyHayes
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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes Woops, my mistake! Sorry!

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

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

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (16,844)