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

Combobox/sharepoint

Hi i'm going mad using combox, i read a lot of stuff but nothing worked

i have an edit form in which i modify my applicants, the combobox is used to insert the current company

 

so i have two data sources in sharepoint (applicants and companies)

 

when i try to set item of this combobox i used distinct formula, or even Table.column 

the only thing that works is the "table.column", the distinct formula do not find record

 

the formula i use to update data card (combobox.selected.Idposition) do not work, it can't find "idcompany" that is the id for the company table

when i open "fields" in combobox, i can't see any datasource on top, even if i selected the correct table when i created the combobox

 

can someone give me an advice on combobox with sharepoint list?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Combobox/sharepoint

Hi @diego_marino ,

Have you changed the Azienda column in your SP list?

 

Please consider save your SP List into a Collection, then check which text string the 'Azienda' column header has been rederened as.

 

In addition, you could also consider go to "List Settings" of your SP list, then click the 'Azienda' column within the Columns part, then within the URL box, check if the internal name is the same as that you used in your app:7.JPG

 

Note: Within PowerApps app, it would use internal name of columns of a SP list as column name.

 

Then within your app, please use the internal name of the 'Azienda' column within above ShowColumns function.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

15 REPLIES 15
Dual Super User
Dual Super User

Re: Combobox/sharepoint

Hi @diegomarino 

 

To get the values for a lookup field,  you can use the Choices() function to get all the possible values.
 
Items: Choices(TableName.ColumnName)
 
Update: DataCardValue10.Selected (If single value allowed)
              DataCardValue10.SelectedItems (If multiple values allowed)
 
Here, DataCardValue10 is the name of control.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Community Support
Community Support

Re: Combobox/sharepoint

HI @diegomarino ,

Which type column do you use within your applicants list to store the selected value within the Company ComboBox? Choice type column or LookUp type column?

 

Based on the formula you provided, I think there is something wrong with it. The result the Table.ColumnName formula returns could only contain the ColumnName column value, it could not contain any other column value.

 

Based on the needs that you mentioned, I think the ShowColumns function could achieve your needs. Please consider set the Items property of the Company ComboBox to following:

ShowColumns('Companies List', "ID", "CompanyName")

Note: The CompanyName represents the column in your Companies list, which you want to use as the display value within the ComboBox.

 

Then you could reference the ID column value from the selected item in Company ComboBox as below:

ComboBox1.Selected.ID

 

In addition, if you want to update the selected company value back to your applicants list, please take a try with the following workaround:

1. If you use Single Text type column to store the selected company value:

Set the Update property of the Company Data card in your Edit form to following:

CompanyComboBox1.Selected.ID

2. If you use Choice Type column to store the selected company value:

Set the Update property of the Company Data card in your Edit form to following:

{
Value: CompanyComboBox1.Selected.ID /* <-- or type CompanyComboBox1.Selected.CompanyName */
}

3. If you use LookUp type column to store the selected company value:

Set the Update property of the Company Data card in your Edit form to following:

{
Id: CompanyComboBox1.Selected.ID,
Value: CompanyComboBox1.Selected.CompanyName
}

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
diegomarino
Frequent Visitor

Re: Combobox/sharepoint

thanks both for the good answers given, and for the time spent

 

i tried some solution, the formulas were good (well, i used them more or less before) but the real problem is that i can't get the value i want.

 

ShowColumns('Companies List', "ID", "CompanyName")

i'm in the "applicants" list, i have a form in which i display every field of it

 

to store the company of an applicant i use the ID of another list, the "companies" one, as you know.

 

now, i delete the textbox related to the CompaniID (the foreign key) and i put a combobox 

 

i use the formula you posted before and it's good till i reach the last value, the "companyName"

 

Showcolumns(Companies;IDcompany;Company)

i can't get the last value, "company", that's the value i want to show but it's not available.

this happens to every other lists i have in my application. It's clear i make some mistake, but i do not know which one

 

Everything should be ok if i can get the last value of the formula (in this case "company" that's the sharepoint name), but it says that the column name is not valid or something similar.

 

Thanks, i hope you can help me on that

Community Support
Community Support

Re: Combobox/sharepoint

Hi @diegomarino ,

Could you please share a bit more about the 'Company' column in your 'Company List'? Is it a Text type column or a Choice type columns?

 

You could only specify Text type column from your SP List within ShowColumns function. If the  'Company' column is a Complex type column (e.g. Choice type column), you could not specify it within your ShowColumns function.

 

If the 'Company' column in your 'Company List' is a Text type column, I think the formula I provided above could achieve your needs:

ShowColumns(Companies; "ID"; "Company")

If the 'Company' column in your 'Company List' is a Choice type column, please consider modify above formula as below:

ShowColumns(
AddColumns(Companies; "CompanyValue", Company.Value); /* <-- The Company represents the Company column in your Companies list */
"ID"; "CompanyValue"
)

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
diego_marino Helper III
Helper III

Re: Combobox/sharepoint

hi the "companyname" column is a single line text....

i tried

 

ShowColumns(Aziende;"ID";"Azienda")

ShowColumns(Aziende;"IDazienda";"Azienda")

("azienda" means "company" and "aziende" is "companies")

"IDazienda" is the name of my id columns for the list

 

The problem is that the last argument "azienda" do not exists, but it is in my sharepoint list and it's a text column

Community Support
Community Support

Re: Combobox/sharepoint

Hi @diego_marino ,

Have you changed the Azienda column in your SP list?

 

Please consider save your SP List into a Collection, then check which text string the 'Azienda' column header has been rederened as.

 

In addition, you could also consider go to "List Settings" of your SP list, then click the 'Azienda' column within the Columns part, then within the URL box, check if the internal name is the same as that you used in your app:7.JPG

 

Note: Within PowerApps app, it would use internal name of columns of a SP list as column name.

 

Then within your app, please use the internal name of the 'Azienda' column within above ShowColumns function.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

diego_marino Helper III
Helper III

Re: Combobox/sharepoint

I can't believe i loose all this time for that stupid error

it was just like you said

 

just other two question

 

1) may i change the internal name of a column in sp list?

2) for "default value" i used "LookUp(Aziende;IDazienda=AziendaID;Azienda)" or "LookUp(Aziende;IDazienda=AziendaID;"title")" but it says that a value "record" is required

 

how can i set the default value?

diego_marino Helper III
Helper III

Re: Combobox/sharepoint

i used {Value:LookUp(Aziende;ThisItem.AziendaID=IDazienda;Azienda)} it works

Dual Super User
Dual Super User

Re: Combobox/sharepoint

Hey @diego_marino / @diegomarino 

 

Glad that you were able to resolve. If your issue is solved, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Attending MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’re streaming the digital event live, or watching on-demand, claim your attendee badge to sport on your profile.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We're launching a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Emergency Response & Monitoring Solution

Emergency Response & Monitoring Solution

Microsoft has created a regional government emergency response and monitoring solution that is built on Power Apps and Power BI.

Top Solution Authors
Top Kudoed Authors
Users online (5,569)