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 / How to set combo box s...
Power Apps
Unanswered

How to set combo box secondary text for SharePoint lookup field

(0) ShareShare
ReportReport
Posted on by 53

I would like to set the secondary text for the SharePoint lookup field (combo box)
AdrianChang_0-1718154821718.png

I read other discussion from community that said use AddColumns() in Items.
However, I set a Filtering already.

AdrianChang_1-1718156383492.png
Please help.

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @AdrianChang - screenshots are useful but in future please also paste your code as Text.

     

    The pattern below is what you will need (please note this has been manually typed, so please look out for any errors):

     

    AddColumns(
     Filter(
     Choices([@'[New] Warehouse Return Submission'].'Machine(s)/ Item(s)'),
     Value in Filter(
     '[New] Machine / Item Status List',
     'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
     ).Title
     ),
     MyNewColumn,
     'Enter your expression here'
    )
  • AdrianChang Profile Picture
    53 on at

    @Amik I would like to add the field 'Code + Name' of the lookup table, but I don't know how to draft the expression.

    BTW I tried your formula like below.

    AddColumns(
        Filter(
            Choices(
                [@'[New] Loan Extension Submission'].'Machine(s)/ Item(s)'
            ),
            Value in Filter(
                '[New] Machine/ Item Status List',
                'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
            ).Title
        ),
        'Code + Name',
        Filter(
            Choices(
                [@'[New] Loan Extension Submission'].'Machine(s)/ Item(s)'
            ),
            Value in Filter(
                '[New] Machine/ Item Status List',
                'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
            ).ID
        )
    )

    AdrianChang_2-1718158556268.png

     

    but the secondary text showed the same as Primary Text.

    AdrianChang_1-1718158530994.png

     

  • AdrianChang Profile Picture
    53 on at

    @Amik Let me give some background about this lookup field.

    This power app is the form of '[New] Warehouse Return Submission'. This lookup field is looking up another SharePoint list of '[New] Machine/ Item Status List'.
    The Primary text of this Combo Box is the Title of 
    '[New] Machine/ Item Status List'.

    And I want the Secondary Text of this Combo Box be the field 'Code + Name' of '[New] Machine/ Item Status List'.

  • AdrianChang Profile Picture
    53 on at

    @Amik Do you have any ideas?

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @AdrianChang - thanks for providing an explanation but unfortunately I do not understand any of it. On reading your code however, I think the below is what you're trying to do: 

     

    AddColumns(
     Filter(
     [@'[New] Loan Extension Submission'].'Machine(s)/ Item(s)',
     Value in Filter(
     '[New] Machine/ Item Status List',
     'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
     ).Title
     ),
     'Code + Name',
     Concatenate(
     Id,
     "-",
     Value
     )
    )

     

    Note: If you make any change to the Items property of a ComboBox, often you will need to "reselect" the field you want from the Primary text and Secondary text menu (even if you're reselecting the same field). If this does not work, try applying the formula to a new ComboBox control. 

  • AdrianChang Profile Picture
    53 on at

    @Amik it is the same.

    The combo box field setting like below.

    AdrianChang_1-1718242353916.png

    The combo box field is a lookup field which is looking up the List - '[New] Machine/ Item Status List' (below).

    AdrianChang_0-1718242212324.png

    Serial No. = Title, which is the Primary Text.
    And I want to make the Secondary Text be 'Code + Name'.

    It is my new try but it is failed also.

    AddColumns(
        Filter(
            Choices(
                [@'[New] Warehouse Return Submission'].'Machine(s)/ Item(s)'
            ),
            Value in Filter(
                '[New] Machine/ Item Status List',
                'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
            ).Title
        ),
        'Code + Name',
        Filter(
            Choices(
                [@'[New] Warehouse Return Submission'].'Machine(s)/ Item(s)'
            ),
            Value in Filter(
                '[New] Machine/ Item Status List',
                'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
            ).Code_x002b_Name
        )
    )
  • AdrianChang Profile Picture
    53 on at

    @Amik Is the secondary text can be the Value and Id only?

    AdrianChang_2-1718250538094.png

                                            AdrianChang_1-1718250381550.png

    I would like to have 'Code + Name' here.

     
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @AdrianChang - is this what you're trying to do?

     

    AddColumns(
     Filter(
     Choices([@'[New] Warehouse Return Submission'].'Machine(s)/ Item(s)'),
     Value in Filter(
     '[New] Machine / Item Status List',
     'Customer Account No.' = DataCardValue1.Text And Status.Value = "Done - Loan"
     ).Title
     ),
     My_Code_Name_Field,
     LookUp(
     '[New] Machine/ Item Status List',
     ID = Id, //note the lower case 'Id'
     'Code + Name'
     )
    )

     

  • AdrianChang Profile Picture
    53 on at

    @Amik Thank you so much. It is exactly what I want. 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard