cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lym
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
Lym
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
VijayTailor
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...

Lym
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
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 (39,520)