Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Error in collect

(1) ShareShare
ReportReport
Posted on by
Hi, hope you are well and thanks for reading. 
I need help with a power apps form that is linked to my SHP list. I need that according to the mails that are stored in the Editors list of my ListA, certain fields are edit or read only. 
From what I researched I need to apply in DisplyMode the following configuration:
 If(
    User().Email in UserListWithEdit,
    DisplayMode.Edit,
    DisplayMode.View
)
But when I want to create as collection ListaDeUsuariosConEdicion I have problems because it does not recognize in the ONSTART the Collect nor the ClearColeect it tells me that a +, * or & operator was expected and the name ListaDeUsuariosConEdicion marks it as name not recognized. Someone is so kind to help me please.
Thanks for taking the time to read.
Regards,
Ana
Translated with DeepL.com (free version)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    41,311 Super User 2025 Season 1 on at
    Error in collect
    Hi
     
    You need to share that code that has the error please. I have some guesses, but its hard to tell you without seeing a screenshot of the error/code.
     
    Usually this happens, because you are doing a Collect/ClearCollect on something that hasn't been defined before, OR has been defined in other places and dooesn't match.
     
    So please share the code/OnStart please.
     
    Also try this,
     
    At the top of the AppOnStart. Before Any other Code, put ClearCollect(ListaDeUsuariosConEdicion , {});
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard