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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / showing/hiding a butto...
Power Apps
Unanswered

showing/hiding a button based on the status of other values

(0) ShareShare
ReportReport
Posted on by 11

Hello to all and many thanks in advance.

I need to hide/show a button in power apps when a specific condition applies.

Here is the scenario:

  • I have a list in SharePoint that contains Incidents created by users
  • I have another list in SharePoint that contain all the Actions related to an incident

Incidents:

Title, Columns etc, Status

2021-12,..., Approved

2021-11,..., In Progress

2021-10,...,In Progress

2021-9,...,Open

 

Incidents Actions:

Incident, Actions, Status

2021-12, action1 , Open

2021-12,action 2, Closed

2021-12,action3, Closed

 

The button i want to show/hide, "Close Incident", should only be available when all Incidents Actions for the Incident are Closed.

Like in the scenario above, since 2021-12,action1 is still open then i cannot close the incident. 

 

I can't get my head wrapped around this. First time building a power app.

Do a filter to get all Actions from 'Incident Actions' where Incident is equal to the actual incident i am working on,

then Countrows(),

then do a lookup to get all Open Actions, count those. If count >0, mean that an action is still open and i cannot close the incident.

 

Help

 

 

 

 

 

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @RoniR Put this in the Visible property of the button (replace theIncident as required),

    IsBlank(LookUp('IncidentAction', Incident=theIncident && Status.Value="Closed"))

  • RoniR Profile Picture
    11 on at

    hi @CNT and many thanks for your reply.

     

    I applied this formula to the Visible property and tested with no success

     

    IsBlank(LookUp('Incidents Actions',Incident.Value=ThisItem.Title && Status.Value = "Closed"))

     

    Since the datasource is 'Incidents Actions', the lookup will take the values or Incident.Value and Status.Value from the datasource correct?

     

  • RoniR Profile Picture
    11 on at

    This worked fine:

    If(CountRows(Filter('Incidents Actions',Incident.Value=ThisItem.Title && Status.Value <> "Closed"))>0,false,true)

     

    I will do more testing.

    Thanks

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @RoniR 

    CountRows is not delegable. You will run into issues if you have a large dataset.

    LookUp() will return Blank() when then is no matching record and IsBlank() will evaluate it to true or false.

  • v-bofeng-msft Profile Picture
    on at

    Hi @RoniR :

    You could try

    IsBlank(LookUp('IncidentAction', Incident=theIncident && Status.Value="Open"))

    Best Regards,

    Bof

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard