cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RRAPH_2022
Frequent Visitor

Use value from multiple column as item for combobox

hello, 

 

I will use Combobox to search record into Sharepoint list. The search must be reseach all record in my list for wich value of column A o column B or Column C is equal to the selected value of de Combobox (in this case the three column contain Username)

thus in my Combobox i will show all value of Column A, B and C   with distinct and Sort. 

With this can i obtain value from column A but how can we add all value from column B and C...
Sort(Disctinct('Source_list'.'ColumnA'.DisplayName).Result,Result,Ascending)

Thanks very much

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
cha_cha
Resident Rockstar
Resident Rockstar

Hello @RRAPH_2022 

 

You would need to use a collection for this.

 

On the OnVisible of the screen where the combobox is, do this:

 

 

Clear(colABC);

ForAll(Disctinct('Source_list'.'ColumnA'.DisplayName),Collect(colABC,{Value: ThisRecord.Result});

ForAll(Disctinct('Source_list'.'ColumnB'.DisplayName),Collect(colABC,{Value: ThisRecord.Result});

ForAll(Disctinct('Source_list'.'ColumnC'.DisplayName),Collect(colABC,{Value: ThisRecord.Result});

 

 

 

 

then on your ComboBox, just use colABC as the data source in the Items Property.

 

cha_cha_0-1670644905913.png

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

View solution in original post

WarrenBelz
Super User
Super User

Hi @RRAPH_2022 ,

Try this - tested and seems to work as expected

With(
   {
      wA: 
      Distinct(
         'Source_list',
         'ColumnA'.DisplayName
      ).Result,
      wB: 
      Distinct(
         'Source_list',
         'ColumnB'.DisplayName
      ).Result,
      wC: 
      Distinct(
         'Source_list',
         'ColumnC'.DisplayName
      ).Result
   },
   Sort(
      Ungroup(
         Table(
            {Value: wA},
            {Value: wB},
            {Value: wC}
         ),
         "Value"
      ),
      Result
   )
)

 

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

View solution in original post

7 REPLIES 7
cha_cha
Resident Rockstar
Resident Rockstar

Hello @RRAPH_2022 

 

You would need to use a collection for this.

 

On the OnVisible of the screen where the combobox is, do this:

 

 

Clear(colABC);

ForAll(Disctinct('Source_list'.'ColumnA'.DisplayName),Collect(colABC,{Value: ThisRecord.Result});

ForAll(Disctinct('Source_list'.'ColumnB'.DisplayName),Collect(colABC,{Value: ThisRecord.Result});

ForAll(Disctinct('Source_list'.'ColumnC'.DisplayName),Collect(colABC,{Value: ThisRecord.Result});

 

 

 

 

then on your ComboBox, just use colABC as the data source in the Items Property.

 

cha_cha_0-1670644905913.png

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

@RRAPH_2022 

 

//untested - but see if it works
Sort(Distinct(Source_list,ColumnA.DisplayName & ColumnB.DisplayName & ColumnC.DisplayName).Result,Result,Ascending)

 

or 

 

//untested - but see if it works
Sort(Distinct(Source_list,Concatenate(ColumnA.DisplayName, " - ", ColumnB.DisplayName, " - " , ColumnC.DisplayName).Result,Result,Ascending)

 

 

WarrenBelz
Super User
Super User

Hi @RRAPH_2022 ,

Try this - tested and seems to work as expected

With(
   {
      wA: 
      Distinct(
         'Source_list',
         'ColumnA'.DisplayName
      ).Result,
      wB: 
      Distinct(
         'Source_list',
         'ColumnB'.DisplayName
      ).Result,
      wC: 
      Distinct(
         'Source_list',
         'ColumnC'.DisplayName
      ).Result
   },
   Sort(
      Ungroup(
         Table(
            {Value: wA},
            {Value: wB},
            {Value: wC}
         ),
         "Value"
      ),
      Result
   )
)

 

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

Hi Warren, it work fine but hi have dubbel value if user exist in the different column but a can create a collection with that en the doing distinct function on the collection. thanks for your help 

Hi Cha_cha, 

it works but on my app i must user ForAll and not ForEach after that must i create a new collection with distinct of collection colABC to have no dubbel value Thanks for your help

You are right, I will correct my answer. Thank you for pointing it out.


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

hi Poweractivate, 
i have test the First proposal  befor search en the forum but i think d-that we can use  & statement in Disctinct function.
if i understand good the second proposa dat must given respons so 

"Record A col1 - record A col2 -..."

"Record B Col1 - record B Col2-..." 

i need 

Record A col1

Record A Col 2

Record B col 1

Record B col 2

...

 

But thank you for you assistance 🙂

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,960)