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

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
Community Support
Community Support

Re: Filter with distinct in a cascading lookup doenst save

Hi @Anonymous ,

 

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
Community Support
Community Support

Re: Filter with distinct in a cascading lookup doenst save

Hi @Anonymous ,

 

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

Anonymous
Not applicable

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

Community Support
Community Support

Re: Filter with distinct in a cascading lookup doenst save

Hi @Anonymous ,

 

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

Anonymous
Not applicable

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. 

Community Support
Community Support

Re: Filter with distinct in a cascading lookup doenst save

Hi @Anonymous ,

 

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


@Anonymous 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

Anonymous
Not applicable

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
Regular Visitor

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,025)