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 / classic combobox Defau...
Power Apps
Suggested Answer

classic combobox DefaultSelectedItems

(1) ShareShare
ReportReport
Posted on by 6
I have a SP List "Locations" that has a field "AllInfo" that I use as a look-up list and another SP list "RecruitInfo" that has a text field "DutyLocation" that stores data from "Allinfo" field. I'm using a combo box (Single selection) to select from the many locations of the locations list, I have changed the combo box to multi selection.  I need separate the default  selected items property.
ForAll(
           Split(ThisItem.DutyLocation, "; "),
               LookUp(Locations, ThisRecord = AllInfo).AllInfo
)
The error that I'm getting is: Incompatible types of comparison These types can't be compared: Records , Text
 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    I cannot see your data, so have simply looked at syntax here - try
    ForAll(
       Split(
          ThisItem.DutyLocation, 
          "; "
       ) As _Data,
       {
      Value:
      LookUp( Locations, _Data.Value = AllInfo ).AllInfo
    ​​​​​​​ } )
    however what I am unclear on here is that if you are after the AllInfo field value in Locations, where the AllInfo field equals the value in each delimited item in DutyLocation, why bother with the LookUp as you already have the value.
     
     
    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    Buy me a coffee

     
  • RacRig5407 Profile Picture
    74 on at
    I've been working with multi-select combos as People-Pickers lately, and here is how I'm getting an Edit form to display the previously saved values:

    If(IsBlank(Parent.Default), [], Filter(colTeamLeads, Email in Parent.Default))

    or another example for a single-select, where you can use = :

    If(

        IsBlank(Parent.Default),
        [],
        Filter(
            colBUGTMContacts,
            DisplayName = Parent.Default
        )
    )

    I'm using collections, but I think you could do the same with Locations.AllInfo. Hope this helps. If you're working with the DefaultSelectedItems property, I assume you're in an Edit form (not in New mode), right?  

    In my examples, I'm saving combobox values to SharePoint in Text fields. Then in the Edit form mode, this is how I'm getting the control to display back to me what was saved in SharePoint.

     
  • CU21102350-0 Profile Picture
    6 on at
    Hello Warren, 
    Thanks for your reply. I'm working with SP list text field (DutyLocation), in order to save values from a combobox you have to save as a text value i.e. Concat(Combobox.SelectedItems.Allinfo & "; ").
    To pull the data saved from the DutyLocation text field I can use {Value:ThisItem.DutyLocation}, all this works fine!
    However, this field needs to be edited and here is where the problem occurs.
    1) The combobox does display the correct information and user can select a new location but when saving it only sees the new selection not the existing selections.
    2) The data comes in as one concatenated string, If the data consists of two or more previous locations and the user wants to remove one of the selections it can't be done it removes all the data.
     
    This is the reason I need to split the data. Your help is truly appreciated, thank you in advance
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    OK - that is a whole new issue - what are you using to write back the data. I am assuming you want to append it to the existing data ?
  • Suggested answer
    CU21102350-0 Profile Picture
    6 on at
    Thanks for your reply RacRig5407.
     
    I got it to work by setting the following properties on the combobox:
     
    DefaultSelectedItems =  Filter(Locations, AllInfo in Parent.Default)
     
    Datacard property Update = Concat(combobox.SelectedItems,AllInfo & "; ")

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