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 / Making a field visible...
Power Apps
Answered

Making a field visible based on the values in Multi selection field

(0) ShareShare
ReportReport
Posted on by 215

I am working on visitor request application. 

 

The departments the visitors are planning to visit are chosen from the check boxes in MS form. The data is then written in SharePoint List. As the sharepoint list is updated via power automate, the field has square brackets by default. 

 

I am making a field visible based on the value selected in he multi selected field.

If("Design" in VisitingAreaUpdateRequest.SelectedItems.Value || "Fabrication" in VisitingAreaUpdateRequest.SelectedItems.Value || "CAD" in VisitingAreaUpdateRequest.SelectedItems.Value,true,false)

 

Sharepoint list value has ["Design",Fabrication","CAD]

 

I want to make the people search field visible based on the departments chosen. If I choose the departments in the PowerApps form, I am able to see the respective manager (people search) field. But with the default data in the list, the manager field is not visible. I think it is because of the square brackets. I am not sure what is the best way to achieve this. Any help is highly appreciated. Thank you in advance.

PowerUser19_0-1684288229687.png

 

 

 

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @PowerUser19 ,

    If the Items are

    ["Design",Fabrication","CAD]

    than that is simply a Table with those values and an output of .Value. I assume here that the Combo Box is multi-select as you have used .SelectedItems and it is possible for other values to be in there (or why test for the only possibilities). If all of that is true, then the Visible of (you do not need If/true/false) should be simply 

    "Design" in VisitingAreaUpdateRequest.SelectedItems.Value || 
    "Fabrication" in VisitingAreaUpdateRequest.SelectedItems.Value || 
    "CAD" in VisitingAreaUpdateRequest.SelectedItems.Value

    is there something above that is not true ?

  • PowerUser19 Profile Picture
    215 on at

    Hi @WarrenBelz ,
    Thanks for the quick response. The field has other items as well. The search goes like, If CAD OR DESIGN OR FABRICATION is chosen, show the approver/manager field to choose the Design department manager. If Engineering or Modelling are also chosen, show the approver/manager from both Design and Engineering department (2 different people search field). So the selection can have multiple values. Based on the areas chosen, the would need to display the approver field for 3 different departments.

     

    If the dropdown as ["CAD,Engineering"], I should be able to show both Design Manager and Engineering manager fields for the users to pick the approvers from each department.

  • PowerUser19 Profile Picture
    215 on at

    The problem is, if the choose those options from the PowerApps Canvas App, the code works as it should. But when the form displays the record from the sharepoint list based on the record chosen from a dropdown, the if condition doesn't work and the manager fields are not visible 

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @PowerUser19 ,

    You can only show what is in the Items - that is the reason for the setting - I am not sure what you mean.

  • PowerUser19 Profile Picture
    215 on at

    Hi @WarrenBelz ,

    Sorry for not explaining clearly in the previous post.

    When I select the record from the dropdown in the PowerApps form(displays the record from SharePoint list), which by default has Design and other areas chosen in the visiting area field. With this default data displayed in the Visiting Area field, the manager fields doesn't appear even if the corresponding areas are already chosen.

    PowerUser19_0-1684306252467.png

     

    But if I make the selection again in the Visiting Area field and choose the department, the corresponding manager fields pops up based on the selection. I need to get the managers field displayed based on the default value displayed in the Visiting Area field without making the selection again.

    PowerUser19_2-1684306776731.png

    Please let me know if the explanation is not clear yet.

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @PowerUser19 ,

    Just so I am clear, are you saying that if the items are selected already in the Combo Box when you open the Form, the field is not visible, but if you re-select them, it becomes visible ?

  • PowerUser19 Profile Picture
    215 on at

    Hi @WarrenBelz ,
    Yes that is correct! 

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @PowerUser19 

    A bit strange that is does not work, however you can also allow for dataset existing values (using your multi-choice field name)

    "Design" in VisitingAreaUpdateRequest.SelectedItems.Value || 
    "Fabrication" in VisitingAreaUpdateRequest.SelectedItems.Value || 
    "CAD" in VisitingAreaUpdateRequest.SelectedItems.Value ||
    "Design" in SPFieldName.Value || 
    "Fabrication" in SPFieldName.Value.Value || 
    "CAD" in SPFieldName.Value.Value
    

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • PowerUser19 Profile Picture
    215 on at

    Thanks @WarrenBelz . 
    I am not able to use the SharePoint Field name directly as stated above. Please let me know if I am missing anything here.

    PowerUser19_2-1684366442661.png

    I tested the dropdown selected value in a label . Not sure why it is returning false though the selected items value contains the text that I looking for.

    PowerUser19_1-1684366135364.png

     

     

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @PowerUser19 ,

    If that is on a Form. you need ThisItem. before the field name

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard