cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

ComboBox SelectedItems object to text

Hi all,

 

Sorry if this is a stupid question but i am struggling to find the documentation to turn the item in a combobox into text. It's set so that only one item can every be selected a time. 

 

How do i turn the output from an object to text so that i can use it in a table?

 

Collect(Info, 
 {
  Kit:KitValue,
  Workbook:Text(ComboBox3.SelectedItems), 
  Worksheet:Dropdown1.Selected.Value,
  Information:TextInput1.Text
}
);

It is the workbook line that doesn't work however i'm looking for a command to do that sort of thing.

 

Kind regards,

Colleen

1 ACCEPTED SOLUTION

Accepted Solutions
Mike8
Memorable Member
Memorable Member

Hello Colleen,

Can you try to change the 4th line of the expression to:
Workbook:Text(ComboBox3.Selected.NameOfTheColumn) 

Instead of SelectedItems you need to write Selected.NameOfTheColumn


View solution in original post

13 REPLIES 13
Mike8
Memorable Member
Memorable Member

Hello Colleen,

Can you try to change the 4th line of the expression to:
Workbook:Text(ComboBox3.Selected.NameOfTheColumn) 

Instead of SelectedItems you need to write Selected.NameOfTheColumn


Anonymous
Not applicable

Brilliant, this was what i needed! Thanks @Mike8 🙂

IanMcK
Frequent Visitor

Hi Mike,

 

Do you know how to do the same for multiselect; e.g: ComboBox3.SelectedItems.NameOfTheColumn

 

I'm trying to insert multiple rows into a Sharepoint List:

* Define variables e.g. Var1 = a, Var2 = b, Var3 = c

* Select multiple options from ComboBox (VarCombo) e.g. x, y & x

* Insert multiple rows into a Sharepoint list based on the above e.g.

 

    VarCombo   Var1   Var2   Var3

1          x              a         b        c

2          y              a         b        c

3          z              a         b        c

  

 

I've got close by using a ForAll, but will still only return one of the SelectedValues.

    VarCombo   Var1   Var2   Var3

1          z              a         b        c

2          z              a         b        c

3          z              a         b        c

 

 

Any help appriciated!! 

 

Thanks,

Ian

Mike8
Memorable Member
Memorable Member

Hello,


Yes, we can make it work. Here is an example.


If you have a collection
Button1.OnSelect = Collect(Collection1,{Column1:"A"},{Column1:"B"},{Column1:"C"})
CompoBox1.Items = Collection1
Button2.OnSelect = ForAll(ComboBox1.SelectedItems,Collect(Collection2,{ColumnName1:Column1}))
So Collection2 is your sharepoint list and ColumnName1 is the column in the sharepoint list you would like to write the values from the compobox.

If you use this example as a reference I think you can make it work. Else,let me know if you have an issue please

IanMcK
Frequent Visitor

Hi Mike,

 

I think I'm almost there! Although I'm afriad I don't understrand the requirement for two buttons, and how to get the CombiBox Items in the final collection e.g. Button2.OnSelect = ForAll(ComboBox1.SelectedItems,Collect(Collection2,{ColumnName1:Column1, ColumName2: ComboBox1.SelectedItems.Value}))

 

Have I understood this right?

 

Button1.OnSelect = Collect(Collection1,{Column1:"A"},{Column1:"B"},{Column1:"C"}) - This button collects the Variables
CompoBox1.Items = Collection1 - I'm not sure where this goes?
Button2.OnSelect = ForAll(ComboBox1.SelectedItems,Collect(Collection2,{ColumnName1:Column1})) - This inserts the Variables into the Sharepoint list (although I can't see how to insert the ComboBox Values?

Mike8
Memorable Member
Memorable Member

I am sorry, I could have explained better.
Button1 and CompoBox1 in my example are there to help me use Button2.
Button2.OnSelect expression is important for you to understand how it works.
Button1 creates a dummy collection and I use it as CompoBoxItems.

Lets go to your case..

I'm trying to insert multiple rows into a Sharepoint List:

* Define variables e.g. Var1 = a, Var2 = b, Var3 = c   --- (I suppose these are constants)

* Select multiple options from ComboBox (VarCombo) e.g. x, y & x --- (I suppose that VarCombo is the name of the Compobox and DisplayedComboBoxColumn is the name of the displayed column in the combobox)

* Insert multiple rows into a Sharepoint list based on the above e.g. ---(I don't know the name of the sharepoint list and the columns of the sharepoint list you want to write your values to, so I will use List and the columns of the sharepoint list ListColumn1-4)


Button2.OnSelect = ForAll(VarCombo.SelectedItems,Collect(List,{ListColumn1:Var1,ListColumn2:Var2,ListColumn3:Var3,ListColumn4: DisplayedComboBoxColumn })) 


You need to change List,ListColumn1,ListColumn2,ListColumn3,ListColumn4,DisplayedComboBoxColumn, to the actual names that you use in your app



IanMcK
Frequent Visitor

Here's a screenshot showing what I have currently, as unfortunaly I'm still not able to get it to work;

 

ForAll(ComboBox.SelectedItems,Collect('List1',{Column1: Var1.Text,Column2: Var2.Text,Column3: Var3.Text,Column4: ComboBox.Selected.Value}))  - Image 1 Below

- This only returns the last item in the CombiBox

 

ForAll(ComboBox.SelectedItems,Collect('List1',{Column1: Var1.Text,Column2: Var2.Text,Column3: Var3.Text,Column4: ComboBox.SelectedItems.Value}))  - Image 2 Below

- This returns [objectObject] for each item

 

 

Thanks for your help! Nearly there by the looks of it!!

 

Ian

Mike8
Memorable Member
Memorable Member

Hello Ian, 🙂

Yes, you are so close..
ForAll(ComboBox.SelectedItems,Collect('List1',{Column1: Var1.Text,Column2: Var2.Text,Column3: Var3.Text,Column4: ComboBox.Selected.Value}))

You have set the Column4 to ComboBox.Selected.Value. You need to change it and assign the DisplayedComboBoxColumn to Column4.
What I mean is..
CompoBox has a table as a source. I don't know the name of the source. It can be a collection or a list or whatever.
Let's name the source of the Compobox, Collection1.
Collection1 is a table and has columns. You can see the items, of Collection1 from a specific column, in the Compobox. I named that column DisplayedComboBoxColumn. So, 
ForAll(ComboBox.SelectedItems,Collect('List1',{Column1: Var1.Text,Column2: Var2.Text,Column3: Var3.Text,Column4: DisplayedComboBoxColumn})

If you still have issues, can you please provide the source of your compobox and its structure?

IanMcK
Frequent Visitor

Hi Mike,

 

Thanks again for the reply and help! So close, but yet so far!!

 

CombiBox Source = Collecton name "Set1" with two Columns "Column 1" & "Column 2"

This created the Collection "Set1" - ClearCollect(Set1, {Column1: "1", Column2:"x"}, {Column1: "2",Column2:"y"} ,{Column1: "3",Column2:"z"})

 

ComboBox.Items = Set1.Column2

 

Button 2 = Clear('List1') ; ForAll(ComboBox.SelectedItems,Collect('List1',{Column1:Var1.Text,Column2:Var2.Text,Column3:Var3.Text,Column4:Set1.Column2}))

 

Returns: [object Object],[object Object],[object Object] (Screenshot 3 - attahced)

 

Using a lookup returns the last value in the SelectedItems only: (Screenshot 4 - attahced)

Button 2 = Clear('List1') ; ForAll(ComboBox.SelectedItems,Collect('List1',{Column1:Var1.Text,Column2:Var2.Text,Column3:Var3.Text,Column4:LookUp(Set1,Column2 = ComboBox.Selected.Column2,Column2)}))

 

 

Thanks again for your help!

Ian

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Top Solution Authors
Top Kudoed Authors
Users online (3,220)