cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Save Filtered Lookup Value in List Custom Form

Hi Team , 

 

We are filtering the Request Type Column value using below Process Items: Distinct(Filter(lkp_TransferRequestType,Material_Details = materialDetailsVal.Selected.Value).Title,Title)

 

after submitting the form, this column value not saving to the List . 

 

Please help me to resolve this Issue .

 

Please let me know if needs more details 

 

Regards,

Mahesh.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @Anonymous,

Could you please share a bit more about your scenario?

Could you please share a bit more about the Request Type column? Is it a Choice type column or a LookUp type column?

Where do you put the formula that you provided?

I suppose that the Request Type column is a Choice type column, and you type the formula you provided within the Items property of the Combo Box control within the Request Type Data card, is it true?

If the Request Type column is a Choice type column (which don't enable multiple selections) in your SP list, please take a try with the following workaround:

Set the Items property of the ComboBox control (ComboBox1) to following:

Distinct(Filter(lkp_TransferRequestType,Material_Details = materialDetailsVal.Selected.Value).Title,Title)  /* <-- The formula you provided */

Set the Update property of the Request Type Data card (which contains above ComboBox control) to following:

{
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
   Value: ComboBox1.Selected.Value
}

If the Request Type column is a LookUp column, please set the Update property of the Request Type Data card (which contains above ComboBox control) to following:

{
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id: LookUp('YourLookUpList', ReferencedColumn= ComboBox1.Selected.Value, ID),
  Value: ComboBox1.Selected.Value
}

Note: The 'YourLookUpList' represents the SP list the Request Type column references values from. The ReferencedColumn represents the Column in the 'YourLookUpList' list the Request Type column references values from.

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Connecting-to-Data/Lookup-Field-not-saving-value-when-saving-NewForm/m-p/147560

Please also check if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
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

Anonymous
Not applicable

Hey Kris, 

Thanks a ton, 

It is working with below formula .

 

{
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: LookUp(
        lkp_TransferRequestType,
        transferReqTypeVal.Selected.Result = Title,
        ID
    ),
    Value: transferReqTypeVal.Selected.Result
}

Regards, 

Mahesh

View solution in original post

15 REPLIES 15
Community Support
Community Support

Hi @Anonymous,

Could you please share a bit more about your scenario?

Could you please share a bit more about the Request Type column? Is it a Choice type column or a LookUp type column?

Where do you put the formula that you provided?

I suppose that the Request Type column is a Choice type column, and you type the formula you provided within the Items property of the Combo Box control within the Request Type Data card, is it true?

If the Request Type column is a Choice type column (which don't enable multiple selections) in your SP list, please take a try with the following workaround:

Set the Items property of the ComboBox control (ComboBox1) to following:

Distinct(Filter(lkp_TransferRequestType,Material_Details = materialDetailsVal.Selected.Value).Title,Title)  /* <-- The formula you provided */

Set the Update property of the Request Type Data card (which contains above ComboBox control) to following:

{
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
   Value: ComboBox1.Selected.Value
}

If the Request Type column is a LookUp column, please set the Update property of the Request Type Data card (which contains above ComboBox control) to following:

{
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id: LookUp('YourLookUpList', ReferencedColumn= ComboBox1.Selected.Value, ID),
  Value: ComboBox1.Selected.Value
}

Note: The 'YourLookUpList' represents the SP list the Request Type column references values from. The ReferencedColumn represents the Column in the 'YourLookUpList' list the Request Type column references values from.

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Connecting-to-Data/Lookup-Field-not-saving-value-when-saving-NewForm/m-p/147560

Please also check if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
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

Anonymous
Not applicable

Hi Kris, 

 

Request Type is Lookup type Column in PowerApps created List . 

I am using this column Items(Request Type) property to get the filtered values .

 

I could able to use below formula at Datacard 'Update" Property , But No Luck 

{
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id: LookUp(lkp_TransferRequestType, Material_Details= transferReqTypeVal.Selected.Result, ID),
  Value: transferReqTypeVal.Selected.Result
}

Please help me .

 

Anonymous
Not applicable

Hey Kris, 

Thanks a ton, 

It is working with below formula .

 

{
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: LookUp(
        lkp_TransferRequestType,
        transferReqTypeVal.Selected.Result = Title,
        ID
    ),
    Value: transferReqTypeVal.Selected.Result
}

Regards, 

Mahesh

View solution in original post

Anonymous
Not applicable

Hi @v-xida-msft,

 

For the above column (Lookup) - In Edit mode , I could not able to get the loaded value.

I am assigning look up column saved value to another text box , It is showing as empty in page load

 

dcv_WorkOrderNumber.Default=TransferReqTypeVal.Selected.Result

 

Based on Transfer Request Type value selection , I am hiding some other controls in the Page . It is working as expected in NewMode , but not in Edit mode because TransferReqTypeVal.Selected.Result is as well empty in edit mode . 

 

Please find the attached snapshot for reference .

 

Regards,

Mahesh.

 

I had this same issue recently and after looking at what is returned by Choices() I noticed it always returns objects with an "Id" and a "Value" field.   The Filter() in my Items property returned just the elements from my list.  I was able to get the values to start saving by using RenameColumns() to change the "ID" to "Id" and "Title" to "Value".  Then my values started saving as I would expect with the Update property as DataCardValue.Selected.

From you example this might work:
{lookup control}.Items=RenameColumns(Distinct(Filter(lkp_TransferRequestType,Material_Details = materialDetailsVal.Selected.Value).Title,Title), "ID", "Id", "Title", "Value")
{dataCard}.Update = {lookup control}.SelectedItem

It worked for both my Drop Down Lists and my Lookup multi-select controls.

@v-xida-msft 
Thanks for your reply, its working for me in case of single select but if we have to save multivalue in lookup , how to do that?

Hello @v-xida-msft ,

 

I have a simular case but with dropdownlist. (doesn't have the update function lik a combobox) 

 

the user selects an item in the browsegallery and it navigates to the "edit screen". 

 

I Changed the items property of the dropdownlist. (filtered on another list with user data. )

ShowColumns(Filter(gebruikers;Diensten.Value = "CMT Niv3"); "NaamGebruike") 

Because of that ,i assume that the submitform function doesn't work any more. In the editform, the columns type are lookup columns. Can also be a raison? 

 

I tried to achieve it with the on change function but it doesn't work. The list isn't upated. 

When i paste it into the update function of the datacard. It doesn't work as well.

 

Schermafbeelding 2019-12-28 om 12.21.28.png

 

 

 

Hello, 

 

I fugured out to filter the choices of the dropdown (based on a value in another list) 

Then I could use submitform again and don't have to patch. 

 

 

Will this work for multi select dropdown or ComboBox?

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 (7,859)