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

How to save/update dropdown and multi lookup value to SharePoint list

1. I have a collection, that is displaying value as dropdown binds in the items of dropdown

enitty.png

2. Items- Filter(EntityFilter, Default_YN=true).Title
Entity filter is a collection, because true or false not working as expected. so did a collection and filter values based on that.
DefaultSelectedItems value is set as- EntityFilter.ID

annotation.png

3.In DataCard -update, using below code

DataCard -update- ddlEntity.SelectedItems

4.

Need a help on below,

I have a patch and try to update, the below code, but it fails


Patch(MainList,
Defaults(MainList),
{
Entity:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:ddlEntity.SelectedItems,
Value:""}
}
)

bar1.PNG

 

I assume in selected item of odata, we need to pass id, but dont know how to pass the id.

Step:5

 

In the same way i have multi lookup to save in to sharepoint list- do share some light on it.

a. In start up of - setting lookup by filtering data.

4444.PNG

b.In screen visible i am setting the below code in collection

555.PNG

c.And binding the value dpssExemptedYes in Items of the control

Patch(
MainList,
Defaults(MainList),
{
Title:lblTitle,
DPSSExemptedList:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:dpssExemptedYes,
Value:""
}
}

)

Can anyone assist me to save multi lookup values to list

3 REPLIES 3
v-siky-msft
Community Support
Community Support

@appuser5 

For your first problem

What is the data source of EntityFilter collection? from Entity list? 

Which column does the Entity column in Mainlist look up to? Title?

If my assumptions are right.

1. Modify the Items property of ddlEntity:  

 

Filter(EntityFilter, Default_YN=true)

 

2. Modify the patch function as below:

 

Clear(Col);ForAll(ddlEntity.SelectedItems, Collect(Col,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:ID, Value:Title}));
Patch(MainList,
Defaults(MainList),
{Title:"Test",
Entity: Col
})

 

 

For your second problem

1. Remove '.Title' in OnVisible property

2. Modify the Patch function

 

Clear(Col2); ForAll(dpssExemptedYes, Collect(Col2,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:ID, Value:Title}));
Patch(
MainList,
Defaults(MainList),
{Title:lblTitle,
DPSSExemptedList: Col2})

 

Sik

 

Which column does the Entity column in Mainlist look up to- I am getting Entity from Lookup column and place it in a collection called Entity Filter.

 

I have a clarification, do you setting up a collection Col to entity filter or creating new collection and assign to 'odata:', so the collection contains the id to pass value, right?

I will work it out and get back

@appuser5 

I mean what is the related column of your Entity column(LookUP)? 

To patch LookUp field of SharePoint,  you have to patch a record containing '@odata.type', Id and Value.

Id is the related record ID, and Value is the related column.

 

Snipaste_2020-01-30_15-12-33.png

Also, could you share the Formula you used to generate EntityFilter collection?

Sik

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,615)