web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display selected seque...
Power Apps
Answered

Display selected sequence value from Combo Box into a text label

(1) ShareShare
ReportReport
Posted on by 225
I have the below code on the items value of a combo box that will check how many desks are free for suite 2.01 (possible 24 desks free) & 2.01b (possible 6 desks free) and then allow the user to select how many desks they want to book based on how many are available.  I then want the value selected in the sequence combo box to be displayed in the "No. of Desks" label in the summary section, but i cant figure it out.  I've tried "DataCardValue19_3.selected", "selecteditems" and the selected value wont display in the label.  How can I get the selected sequence value select in DataCardValue19_3 to display in a label?
 
Thanks in advance.
 
DataCardValue19_3 Items Code
If(
    DataCardValue19_2.Selected.Value = "2.01",
    Sequence(VarSuite201FreeDesks),
    If(
        DataCardValue19_2.Selected.Value = "2.01b",
        Sequence(VarSuite201bFreeDesks),
        []
    )
)
 
Categories:
I have the same question (0)
  • Suggested answer
    Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    Hi @,
    Ideally it should work, but can you explain the logic behind the item's property of DataCardValue19_3.
    like sequence(.....)


    try adding a variable in OnChange Property of DataCardValue19_3.
     Something like 
    Set(var_sel_n_desk,Self.Selected.Value);
    
    and use the var_sel_n_desk as text property in No. of desks label / text control.

    Please give the mentioned solution a try and let me know whether it works for you.
    If it solves your issue, feel free to mark this thread as answered.
    Please make sure to like the response!
    Thanks!
    - Hemanth Sai

  • StuartSmith Profile Picture
    225 on at
    So the whole process is...
     
    A user selects a date and it actions this... Counts the number of SP List rows that match the date and "Suite" = "2.01"
    Set(
        VarSuite201BookedDesks,
        CountRows(
            Filter(
                Bookings,
                DateValue(Date) = DateValue(dpSelectedDate.SelectedDate) &&
                Suite = "2.01"
            )
        )
    );
     
     
    Then the variable "VarSuite201FreeDesks" from my first post is populated by subtracting the result of the above code with the number of desks, giving me the number of free desks. So as an example "VarSuite201FreeDesks" example could be 5. This variable is used to populate the "Select no. of desk" combo box so 5 desks, the combo box will have 5 items (1 to 5).  Im then simply trying to display the value selected in the combo box in a label.
     
    On the number of seats label i try putting "DataCardValue19_3.selected" and get the below error, so looks like the value for the number of seats combo box is being stored as a record, despite only selecting 1 value from the combo box
     
     
    I also tried your suggestion and get the same error about a record.  Any advice would be great.
    Thanks in advance
  • Verified answer
    stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    Use [] will cause problem, since Sequence() generate single column (Value) table, but not for []
    try to use Sequence(0) instead.
    If(
        DataCardValue19_2.Selected.Value = "2.01",
        Sequence(VarSuite201FreeDesks),
        If(
            DataCardValue19_2.Selected.Value = "2.01b",
            Sequence(VarSuite201bFreeDesks),
            Sequence(0)
        )
    )
     
  • StuartSmith Profile Picture
    225 on at
    @stampcoin That fixed it, thank you so much.
     
    Stuart
  • Suggested answer
    Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    HI @StuartSmith ,
    just to give some more context of what @ is saying.

    In Power Fx, every branch of an If() must return the same data type. Here’s what’s going on:
    If(
      DataCardValue19_2.Selected.Value = "2.01",
      Sequence(VarSuite201FreeDesks),
      If(
        DataCardValue19_2.Selected.Value = "2.01b",
        Sequence(VarSuite201bFreeDesks),
        []                // ← this causes a type mismatch
      )
    )
    
    Sequence(...) always returns a table with one column (Value).
    [] is not a table - it’s just an empty literal (empty table no schema) - so Power Fx silently throws an “invalid argument type” error (sometimes it won't show up in app checker also).
    the Solution is as proposed by Stampcoin: 

    Replace [] with Sequence(0). That still returns a table (just zero rows), so every branch hands back the same table schema 
     
    If(
      DataCardValue19_2.Selected.Value = "2.01",
      Sequence(VarSuite201FreeDesks),
      If(
        DataCardValue19_2.Selected.Value = "2.01b",
        Sequence(VarSuite201bFreeDesks),
        Sequence(0)      // ← empty table, same schema as other branches
      )
    )
    

    Please give the mentioned solution a try and let me know whether it works for you.
    If it solves your issue, feel free to mark this thread as answered.
    Please make sure to like the response!
    Thanks!
    - Hemanth Sai

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard