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 / Disabling Gallery Butt...
Power Apps
Answered

Disabling Gallery Button Based on Collection Value

(0) ShareShare
ReportReport
Posted on by 133

I'm having a hard time wrapping my head around this.  I am working on a prototype for a simple "Task Status" app that will allow new hires to update the status of assigned activities as they complete them.  When they 1st go into the app, I only want Step 1 button to be enabled.  Once they submit the task, it writes to a SharePoint list (which I cache into a collection in the app).  So, there is a lot of back and forth in/out of the app until they complete all 4 steps.  Once Step 1 is done Step 2 should then be active, and so on.

 

What I would like to do is disable any steps that they have not completed, forcing them to go in order. My idea was that based on the entries recorded in the SharePoint list (cached to collection) I could "mark" each gallery item button as completed or not by activating the next step in order.

 

However, I am struggling to build the logic in the DisplayMode parameter that will account for every step in the gallery (there are 4 steps) and make it so that the button status is unique to that gallery item.  I have only been able to make it an all or nothing edit/disabled option for the buttons because I can't seem to tie it to "ThisItem". I have attached pics of my app as well as the database so you can visualize that I'm doing.  Hoping there are some suggestions out there.

 

app.png

 

table.png

Categories:
  • TheRobRush Profile Picture
    11,128 Moderator on at

    How have you set up your gallery items to make what appears to be a single record in sharepoint, 4 records in your gallery

  • robgar Profile Picture
    133 on at

    Because my gallery is not showing what is in the SharePoint list.  My gallery is displaying another collection of tasks, and once the user clicks the "mark as Complete" button, I am then patching to the same record in the SharePoint list (based on user email alias).  That's how I can get all 4 steps in the same record vs having 4. The app works.

     

    So then I have a 2nd collection that pulls in the SharePoint list and it includes the completion status of each step.  It's from that collection that I want to assign the button's status.  For example .. if Step 1 = true/completed, then disable the button for Step 1 gallery item, and then enable the button for Step 2 gallery item.  Make sense?

  • Verified answer
    robgar Profile Picture
    133 on at

    Looks like I needed to step away .. the solution came to me.  Set the following code on DisplayMode property.  The result is that the users must follow the steps, and the next button in the series come active once the preceding Step is completed.

     

    Just need to do a little clean up on the button text once marked as complete but this should do it!

     

    Switch(ThisItem.Step,
     "Step 1",
     If(Concat(colCurrentUserTasks,'Step 1'),DisplayMode.Disabled,DisplayMode.Edit),
     
     "Step 2",
     If(Concat(colCurrentUserTasks,'Step 2') || !Concat(colCurrentUserTasks,'Step 1'),DisplayMode.Disabled,DisplayMode.Edit),
     
     "Step 3",
     If(Concat(colCurrentUserTasks,'Step 3') || !Concat(colCurrentUserTasks,'Step 2'), DisplayMode.Disabled,DisplayMode.Edit),
     
     "Step 4",
     If(Concat(colCurrentUserTasks,'Step 4') || !Concat(colCurrentUserTasks,'Step 3'), DisplayMode.Disabled,DisplayMode.Edit)
    )

     Beginning of processBeginning of processSteps 1/2 are doneSteps 1/2 are done

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard