cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Yusha
Level: Powered On

Can not get LookUp selection to Save to my List

I have Main ListList AList B

 

My Main List will have two LookUp fields in it that were created via the SharePoint Online Designer. So Main List will have a LookUp column that contains the Items in List A. Similarly, there will be another LookUp field in Main List that will be a LookUp column that will contain the Items in List B but these items will be Filtered() by the Title = to something using the "Customize Forms" feature.

 

Now, the issue..

 

When I select the options for the LookUp fields the List A LookUp drop down selction works fine.

 

The List B LookUp drop down selection works fine, but when I press save for some reason it doesn't save the selection I made. I pressed customized forms prior to this and my LookUp ComboBox field that holds the Items in List B has a Filter() on it in the Items section, because I only want specific items from that list. Is this causing the issue? Also that ComboBox is coming from a difference source, does that matter ? I had to change the Data Source connection for that ComboBox because I wanted to use the Filter() option and it wasn't working for that LookUp field 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Can not get LookUp selection to Save to my List

Hi @Yusha,

 

If you want to use ListB's data to update the Lookup column in Main List, then you cannot update with SubmitForm function. You will have to use Patch function to update Main List. 

 

For patch usage with lookup field, we need to patch a record rather than a value.

The Record must match the Schema defined under your lookup field, basically, the following should work:

 

Patch(MainList,
         Defaults(MainList),
        {Lookup:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                        Id:Gallery1.Selected.ID,
                        Value:Gallery1.Selected.Title}
              }
         )

 

In this example, Gallery1 should have the data source of List B. And the data source of this Lookup column should be Title column from List B.

 

Regards,

Mona

Community Support Team _ Mona Li
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

1 REPLY 1
Community Support Team
Community Support Team

Re: Can not get LookUp selection to Save to my List

Hi @Yusha,

 

If you want to use ListB's data to update the Lookup column in Main List, then you cannot update with SubmitForm function. You will have to use Patch function to update Main List. 

 

For patch usage with lookup field, we need to patch a record rather than a value.

The Record must match the Schema defined under your lookup field, basically, the following should work:

 

Patch(MainList,
         Defaults(MainList),
        {Lookup:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                        Id:Gallery1.Selected.ID,
                        Value:Gallery1.Selected.Title}
              }
         )

 

In this example, Gallery1 should have the data source of List B. And the data source of this Lookup column should be Title column from List B.

 

Regards,

Mona

Community Support Team _ Mona Li
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

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,968)