cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ErickContieri
New Member

Retrieve Sharepoint list ID on Combobox selecteditem

Hi,
I need to 
retrieve the SharePoint List ID of a record when i select a item on a combobox

 

The case: I have 2 forms, the first form is used by the HR to create training meeting schedules (When a record of a meeting is created, sharepoint auto-creates an ID). The second form is used by employees to register for specific meetings. In this second form, I want to get the ID from the training meeting to link in the employees base.

 

In the employee screen, I have a combobox that brings a list of all the names of the training meetings available. When the employee selects the training that he(she) wants to participate, I want to send de training ID for the base.

 

If I try to get the id like this:

formname.ID

I get none

 

If I try comboboxName.SelectedItem.ID

Same result...

 

How can I get the ID from the selected training in the combobox?

 

 

7 REPLIES 7
StalinPonnusamy
Community Champion
Community Champion

Hi @ErickContieri 

 

Since This will be lookup to other SP list

 

comboboxName.Selected.Id

 

 

Sorry, that did not work. Gives an error. I sent the printscreen

StalinPonnusamy
Community Champion
Community Champion

Hi @ErickContieri 

 

Combobox can return multiple values. So we have to use First

First(ComboboxName.SelectedItems).Value

 

Is it your combo box accepts multiple selections?

I tried those:

First(ComboboxName.SelectedItems).Value - Did not work

First(ComboboxName.SelectedItems).ID - Did not work

First(ComboboxName.SelectedItems.ID) - Did not work

First(ComboboxName.SelectedItems.Value) - Did not work

 

The id is not recognized

jkic
Frequent Visitor

Hi @ErickContieri 

It's not the most elegant solution, but you should be able to get it using a Lookup....

LookUp(yourList,Name=comboBoxName.Selected.Result,ID)

StalinPonnusamy
Community Champion
Community Champion

Hi @ErickContieri 

 

The ID you are trying to get is all based on the combo box items that you are filling.

 

For Example, I have an SP list and reference the Event SP List. So Combobox Items will

Choices([@IssueTracker].SingleEvent)

 

In this case, IssueTracker is Main or transaction SP List

SingleEvent is a column name for Event SP List

To get Id of the Combo box will be

First(DataCardValue12.SelectedItems).Value

 

If the combo box is multi-select then

Concat(ComboboxName.SelectedItems.Value,Value,",")

 

StalinPonnusamy_0-1631823694369.png

 

 

If your combo box uses a filter or Distinct or data source then how to access the combo box varies.

 

In this example combo box items property is

EventIItinerary.Title

 then to get the value is

First(DataCardValue12.SelectedItems).Title

 

You may need to use Result to get ID

comboBoxName.Selected.Result

 

ErickContieri
New Member

I did this and worked: LookUp(dbase;Title = ComboBoxName.Selected.Name;ID)

 

Thankyou guys!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,381)