cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RadhaSamak
Helper I
Helper I

Auto select newly added record in combo box

Hi,

I have a case where in Form1, provided a combo box "ComboBox1" as Contract Employee's, If contract employee is not available in the list, Then provided an option to add new contractor to the Sharepoint list using Form2,
Upon submitting  Form2, I want to the newly added record to be selected automatically in Form1.

 

Can someone guide me how to do that?

 

Thanks,

Radha

6 REPLIES 6
WarrenBelz
Super User III
Super User III

Hi @RadhaSamak ,

I will give you one scenario that works, but it may involve something different in the Items of Form1.
When you initially select the item from the gallery also put this

Set(
   varID,
   ThisItem.ID
)

Then set the Items of Form1 to 

Lookup(
   YourListNme,
   ID=varID
)

Now on the OnSuccess of Form2

Set(
   varID,
   Form2.LastSubmit.ID
)

 Now when you go back to Form1, it will display the item you have just posted.

 

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.

Thanks for that @WarrenBelz 

But I want to set the newly added record as a selected value for combo box not for the form.

 

@RadhaSamak ,

I am a little confused - your request was

Upon submitting  Form2, I want to the newly added record to be selected automatically in Form1.

What are the Items and DefaultSelectedItem of the Combo Box and what exactly do you want to see in it?

 

 

Well Sorry for confusion..!!

Here is what I was looking for,

I have Form1 used to created a new request for contractor extension request .

 

In Form1 I have a comboBox which is actually a look field of type "ContractEmployees"[Title[Display Name], Name[People or group], cost ], 

am Showing Title[Display Name] of the contractor in form1 - comboBox.

 if contractor details are not found in form1->combo box, then add new contractor details using Form2.

 

Once Form2 is submitted, then the newly added contract's title should get auto selected in Combo box of form1.

 

 

 

@RadhaSamak ,

That is a totally different question to what you posted and you have not answered either of the questions I asked.

 

 

What are the Items and DefaultSelectedItem of the Combo Box and what exactly do you want to see in it?

 

Well, the Form1's Mode is NewForm and hence DefaultSelectedItem  for ComboBox is in Form1 is "Parent.Default"

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (37,237)