Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

LookUp and Show / Hide Fields

(1) ShareShare
ReportReport
Posted on by 271
Hello,
 
I've 2 SharePoint list connected to the PowerApps form
 
1st one is used to display all the field within the form (named as SupplierDetails) and the Items property is set as below. This is a combo box named as Customer
Sort( Distinct('SupplierDetails',Title),Value)
In 2nd SharePoint list, I've 2 columns (Title and Category). In Title we'll have all the same names as stated in the above Combo box. This list is to be used for Lookup
 
 
My requirement is - when a specific Customer name is selected, I want to show specified fields into the form on Visible property
 
For example - If Customer A is selected, display field 1, 2, 3, 4 and 5. And if Customer B is selected, display field 2, 3 and 5
 
Much Appreciated, if someone could assist. Thanks!
  • Suggested answer
    DBO_DV Profile Picture
    DBO_DV 4,415 on at
    LookUp and Show / Hide Fields
    Hey @Prem4253
     
    Adding that many columns to the database wouldn't be efficient. 
    You could try something like this : 
    I assume that every datacard stands for one or a couple of categories.
    Try this instead: 
    !IsBlank(
      LookUp(
        Filter(
          List2,
          Title=Dropdown.Selected.Value
        ), 
        Category="Aluminium" OR Category= "Fuel"
      )
    )
     

    If this solved your problem, please mark it as Solved to help others find the solution faster.
    If you found it helpful, consider giving it a Like to support each other in this community!

    Thanks, and happy building!

  • Prem4253 Profile Picture
    Prem4253 271 on at
    LookUp and Show / Hide Fields
     
    I have around 180 categories. Few of the examples below. We can have duplicate Category in Category column.
     
    Name Category
    Customer 1 Aluminium
    Customer 1 Cold Rolled Steel
    Customer 1 Fuel
    Customer 1 Hot Dipped Galvanised
    Customer 1 Hot Rolled Steel
    Customer 1 Paint
    Customer 1 Pallet
    Customer 2 Carbon Steel
    Customer 2 Fuel
    Customer 2 Hot Dipped Galvanised
     
    If Customer 1 is selected in the Combox, display 7 fields associated to customer 1.
    If Customer 2 is selected in Combobox, display 3 fields associated to customer 2.
     
    I'm OK to add around 100 columns into the SharePoint list, but want to display only those fields associated to the Customer name selected in Combobox.
     
    Can you please elaborate on this more ?
  • Suggested answer
    DBO_DV Profile Picture
    DBO_DV 4,415 on at
    LookUp and Show / Hide Fields
    Hey, 
     
    I don't know how maby Categories you will have but if its only a handfull a simple switch formula should do the trick:
    Switch(LookUp(List2,Title=Dropdown.Selected.Value).Category,1,true,2,false,3,false,4,true)
    You just need to add and update this formula on every Datacard's Visible property. 
    But it deepends on how many categories you will have at the end. It's not managable for 50 categories for example. 
    There you would have to work on your database a bit to make it scalable. 

    If this solved your problem, please mark it as Solved to help others find the solution faster.
    If you found it helpful, consider giving it a Like to support each other in this community!

    Thanks, and happy building!

  • Suggested answer
    WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    LookUp and Show / Hide Fields
    You would need to make the Visible property of the Data Cards for fields 1 and 4
    ThisItem.Customer = "Customer A"
    then the rest can remain with Visible as true
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard