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

How to add another ON-START code?

Hey

I have this line of code in my ONSTART function:

 

ClearCollect(collAppUsers;Administratörer_SystemApp);;Set(IsUser;CountRows(Filter(collAppUsers;Lower(Rubrik) =Lower( User().Email))) = 1)

It checks if a useremail is in a sharepoint list (called administratörer_systemapp)

Then i put this on a button visible function

If(IsUser;true;false)

So if the users email is part of a list, then the button is visible.

 

This works great for me.

 

But now i have a need of adding another list to control other buttons that should be visible or not based on if the users email is part of that list.

How to add another "on start" line of code like the one above. i cant find a way of just adding it after the current one.

 

This is the "new" code with new list and new variable

ClearCollect(collAppUsers;AdminCreator_Systemapp);;Set(IsCreator;CountRows(Filter(collAppUsers;Lower(Rubrik) =Lower( User().Email))) = 1)

And then the idea is to put this on some buttons visible function

If(IsCreator;true;false)



But how to add this line of code after the one i already have?
I have tried ";" "&" ";;" and i still get different errors. What method is correct?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Oskarkuus
Level: Powered On

Re: How to add another ON-START code?

I found the solution. Collappuser is a collection. I just had to rename it on the second code and now it works.
5 REPLIES 5
Super User
Super User

Re: How to add another ON-START code?

Hi @Oskarkuus 

Double semi-colons should work for you (;Smiley Wink. Can you describe the error you see when you use this syntax?

Oskarkuus
Level: Powered On

Re: How to add another ON-START code?

screenshot: http://prntscr.com/ng7t8e

this error is what i get

can you see from this what i am doing wrong?

 

the error message is translated to: Function Lower contain arguments that are wrong......

 

 

Super User
Super User

Re: How to add another ON-START code?

Hi @Oskarkuus 

Can you confirm what Rubrik is in your formula? Is this a field in colAppUsers? If so, what's the data type of this field (is it a text field?)

Oskarkuus
Level: Powered On

Re: How to add another ON-START code?

What is ColAppUser? I though it was som powerapp function.

I dont have any data source with that name.

RUBRIK = title (in swedish).
Title/rubrik is the first column in a sharepoint list. A text field containing my email adress.

Oskarkuus
Level: Powered On

Re: How to add another ON-START code?

I found the solution. Collappuser is a collection. I just had to rename it on the second code and now it works.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 31 members 4,227 guests
Please welcome our newest community members: