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

Set Edit form combo box value from a variable

Hi Experts,

 

In SharePoint, I have a list named Vendor with vendor number. I have another list named Invoice with lookup to Vendor.

 

In PowerApps, I have a combo box that displays all the Vendors. I also have an Edit Form for Invoice. This form has a combo box which is the lookup to Vendors. When I select a value from the Vendors Combo box, I am updating a local variable UpdateContext({ varMyVendor: vendor.Selected }).

 

On the Edit form combo box, i'm setting the DefaultSelectedItems to [varMyVendor.Id]. When I click the button that submits the edit form, the Invoice record gets created in SharePoint but the Vendor lookup does not get populated.

 

Any help is appreciated. Thanks in advanced.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Hi @VijayTailor,

 

Thanks for replying but I already tried that and it didn't worked.

 

I have found the solution for this issue.

Below is the source on the Vendor combobox field on the Edit form.
Choices([@Invoices].Vendor_x0020_Number)

 

When I tried to set its DefaultSelectedItems property to varMyVendor.Id it didn't worked. But when I changed it to LookUp(Choices([@Invoices].Vendor_x0020_Number), ID = varMyVendor.Id) it did worked.

View solution in original post

2 REPLIES 2
Highlighted
Resident Rockstar
Resident Rockstar

Hi,

You can use Like below.

Set(SelectedValue,ComboBox4.Selected);

 

Hope your issue is resolved.

 

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Please vote for my idea if you feel, that will help you in the future or good to have in power app.
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Ability-s-to-Select-Icon-from-UIFabric/idi-p/69...

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Preview-Mode-for-All-the-Device-Like-Phone-Tabl...
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Preview-Mode-for-All-the-Device-Like-Phone-Tabl...

Highlighted
Frequent Visitor

Hi @VijayTailor,

 

Thanks for replying but I already tried that and it didn't worked.

 

I have found the solution for this issue.

Below is the source on the Vendor combobox field on the Edit form.
Choices([@Invoices].Vendor_x0020_Number)

 

When I tried to set its DefaultSelectedItems property to varMyVendor.Id it didn't worked. But when I changed it to LookUp(Choices([@Invoices].Vendor_x0020_Number), ID = varMyVendor.Id) it did worked.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,791)