Show Button if value is blank

Scripts and Codes for Power Apps
Post Reply
administrator
Site Admin
Posts: 82
Joined: Mon Dec 03, 2018 10:35 am

Show Button if value is blank

Post by administrator » Tue Jan 30, 2024 9:47 am

Example: I want to use a collection called MySuppliers and based on the record a button must be visible.

First, make sure you have a collection in your app that contains the "supplier" field. If you don't have one yet, you can create it by using the ClearCollect function or any other appropriate method for your scenario. For example, if you have a SharePoint list named "Suppliers," you can create the collection like this in the OnStart property of your app or when a specific screen loads:

Code: Select all

ClearCollect(MySuppliers, Suppliers);
Next, find the button you want to show or hide based on the "supplier" field and select it in the Power Apps canvas.
In the right-hand pane, under the "Properties" tab, find the "Visible" property.
Enter the following formula in the "Visible" property box:

Code: Select all

If(
    IsBlank(LookUp(MySuppliers, !IsBlank(supplier))),
    false,
    true
)

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests