web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can we restrict the fi...
Power Apps
Answered

Can we restrict the fields in PowerApps based on collection or group

(0) ShareShare
ReportReport
Posted on by 62

Here we have two different SharePoint lists belongs to same site. In one SharePoint Site I have all the field names. And another list contains all the fields same as first list along with that step numbers (Refer KSS1). Here we have 5 different teams, and each team have 74 steps of Approvals. Based on the step the flow is in fields  displaymode to be edit or disabled.

KSS1.png
Categories:
  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @Changal the short answer is yes you can restrict by group or collection.

     

    I will share a way of doing it as I am sure there are many ways.

     

    Objective

    Set control to edit or visible based on the workflow step

    Method

    build a collection that will act, as a rule, to determine when a control must be edited or disabled.

     

    Steps

    1. Create a gallery with 74 items to act as the steps: Formula  Sequence(74)

    rubin_boer_0-1670402187402.png

     

    1. Create a local variable when the workflow step is achieved: Formula UpdateContext({wfStep: ThisItem.Value})

    On the OnSelect Property

    rubin_boer_1-1670402311659.png

     

    1. Create a collection to host the rules: collection colRules:

    id: unique identifier

    type: type of rule 0, smaller than, 1 equals a value

    eval: the criteria to determine whether it will be editable else disabled

    (e.g., id: 0,  type: 0, eval: [50] states if the wf is smaller than 50)

    ClearCollect(colRules, 
     {id: 0, type: 0, eval: [50]}, // 0 = smaller
     {id: 1, type: 1, eval: [20]}, // 1 = equals
     {id: 3, type: 2, eval: [15, 16, 20, 23, 34]}, // 2 = in
     {id: 4, type: 3, eval: [15, 16, 20, 23, 34]}, // 3 = not in
     {id: 5, type: 4, eval: [15, 16]} // 4 = between 
    )

     

    Set the edit and disable mode

    Define the rule 

    _type as defined in colRules

    _rulex as you need them

    With(
     {
     _rule0: Index(Index(colRules, 1).eval, 1).Value,
     _rule1: Index(Index(colRules, 2).eval, 1).Value,
     _rule2: Index(colRules, 3).eval,
     _type: 0 //select your rule
     },
     Switch(
     true, 
     _type = 0, If(SomeGallery.Selected.Value < _rule0, DisplayMode.Edit, DisplayMode.Disabled),
     _type = 1, If(SomeGallery.Selected.Value = _rule1, DisplayMode.Edit, DisplayMode.Disabled),
     _type = 2, If(SomeGallery.Selected.Value in _rule2, DisplayMode.Edit, DisplayMode.Disabled)
     )
    )

     

    Result

    rules.gif

    Hope it helps

  • Changal Profile Picture
    62 on at

    Hi @rubin_boer ,

     

     Thank you so much. It really working. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard