cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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

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

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

See below:

 

Autofilin.png

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

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. 

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

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

Hi.. 

I have tried but its not works . 

 

I have applied below formula 

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

 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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