cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alois
Helper III
Helper III

Hide Gallery Items Depending on Sharepoint Column Value

Hi All,

I have a button that OnSelect, will change a dropdown box value from Incomplete to Complete. This will update the item in the Sharepoint list. 

With the same Sharepoint list linked to the PowerApps gallery, how do I hide the item in gallery based on the new dropdown box value? 

Alois_0-1602566287824.png

Gallery View

 

Alois_1-1602566338856.png

Accept Button at bottom right > Update Dropdown value stored in Sharepoint list 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Alois :

Could you tell me :

Which file in the Sharepoint list does The dropdown box update? What is it's data type?

Which items in the gallery do you want to hide?

I assume:

  • There is a Text column named ‘Status’ in your SharePoint List.
  • After clicking the Button, the value of ‘Status’ of the specified record will be updated to "Complete".
  • After clicking this button, gallery only displays the records whose ‘Status’ field is "Complete"

If so, I suggest you use a variable to control the filtering conditions of gallery items.I'v made a test for your reference:

1\Set the apps OnStart property to:

 

Set(TheVar,true) /*TheVar is my custom variable*/

 

2\Set the Button's OnSelect property to:

 

……Your original formula……;
Set(TheVar,false)

 

3\Set the Gallery's Items property to:

 

If(
  TheVar,
  YourSharePointList,
  Filter(YourSharePointList,Status="Complete")
)

 

By default, this gallery will display all items. When you click the button, the records in the gallery whose Status value is not "Complete" will be hidden.

Best Regards,

Bof

 

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @Alois :

Could you tell me :

Which file in the Sharepoint list does The dropdown box update? What is it's data type?

Which items in the gallery do you want to hide?

I assume:

  • There is a Text column named ‘Status’ in your SharePoint List.
  • After clicking the Button, the value of ‘Status’ of the specified record will be updated to "Complete".
  • After clicking this button, gallery only displays the records whose ‘Status’ field is "Complete"

If so, I suggest you use a variable to control the filtering conditions of gallery items.I'v made a test for your reference:

1\Set the apps OnStart property to:

 

Set(TheVar,true) /*TheVar is my custom variable*/

 

2\Set the Button's OnSelect property to:

 

……Your original formula……;
Set(TheVar,false)

 

3\Set the Gallery's Items property to:

 

If(
  TheVar,
  YourSharePointList,
  Filter(YourSharePointList,Status="Complete")
)

 

By default, this gallery will display all items. When you click the button, the records in the gallery whose Status value is not "Complete" will be hidden.

Best Regards,

Bof

 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,301)