cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Wackmack88
Level 8

Filter with distinct in a cascading lookup doenst save

Hi all,

 

I have made a cacading lookup fields. The filters works fine but i can't save the data to SharePoint.

 

Here is the distinct filter 

Distinct(Filter(
    Choices(Testlijstje.DoctypeSubtypeArchief),
    Value in First(collArchief).DoctypeSubtypeArchiefopzoeken.Title
),Value)

 

On the update datacard i have add this:

 

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

DoctypeSubtypeArchiefopzoeken = lookuplist

DoctypeSubtypeArchief  = Column name 

DoctypeSubtypeArchief_DataCard1 = name datacard

 

PowerApps say the code is invalid but i can't see why? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: Filter with distinct in a cascading lookup doenst save

Hi @Wackmack88 ,

 

There is something wrong with your formula. You should use combo box control name to call the selected value, instead of data card name.

So you should modify your formula as below:

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

Please replace the DataCardValue1 to the similar name of combo box in the data card, and check if your issue is fixed.

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

 

View solution in original post

7 REPLIES 7
v-siky-msft
Level 10

Re: Filter with distinct in a cascading lookup doenst save

Hi @Wackmack88 ,

 

Coud you try to use DoctypeSubtypeArchief_DataCard1.Selected.Result?

Due to the Distinct() function, the return value is Result instead of Value. Please modify your formulas as below:

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

Hope this can help.

Best regards,

Sik

Wackmack88
Level 8

Re: Filter with distinct in a cascading lookup doenst save

Thanks for your answer, if i look at the autopopulate option, i can select result or value, etc. 

See below:

 

Autofilin.png

v-siky-msft
Level 10

Re: Filter with distinct in a cascading lookup doenst save

Hi @Wackmack88 ,

 

There is something wrong with your formula. You should use combo box control name to call the selected value, instead of data card name.

So you should modify your formula as below:

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

Please replace the DataCardValue1 to the similar name of combo box in the data card, and check if your issue is fixed.

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

 

View solution in original post

Wackmack88
Level 8

Re: Filter with distinct in a cascading lookup doenst save

Thanks for your answer, still an invalid argument type...
Here is the error, i got the update on the datacardvalue instead of the combo card. 

 

Update error.png


Very frustrering, the solution works but can't update my card. 

v-siky-msft
Level 10

Re: Filter with distinct in a cascading lookup doenst save

Hi @Wackmack88 ,

 

I want to confirm if the 'DoctypeSubtypeArchief' is the field of 'DoctypeSubtypeArchiefopzoeken'.


@Wackmack88 wrote:

Here is the distinct filter 

Distinct(Filter(
    Choices(Testlijstje.DoctypeSubtypeArchief),
    Value in First(collArchief).DoctypeSubtypeArchiefopzoeken.Title
),Value)

From the formulas above, DoctypeSubtypeArchief seems to be the column of 'Testlijstje'.

What is the column name that 'DoctypeSubtypeArchief'  lookup to?

BR

Sik

Wackmack88
Level 8

Re: Filter with distinct in a cascading lookup doenst save

Yes! It works now! I changed the internal name and now the Distinct and filters works perfect! Awesome, how can i thank you 🙂

Dipesh
Level: Powered On

Re: Filter with distinct in a cascading lookup doenst save

Hi.. 

I have tried but its not works . 

 

I have applied below formula 

Distinct(PMMASTER,FormulaDescription)  data not capture to sharepoint . 

 

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (7,063)