Hello,
I want to delete some value if I don't used them in other list, to put it simply, I have 2 list, one has a text column where I enter my data and the other list with a lookup column where I can use the data I enter previously.
For exemple, if I create a data named "Day" don't use it If I create a data item called "Day" and I don't use it, I must be able to delete it and if I do use it, I must not be able to delete it.
I hope to be clear in my explanation,
Thanks in advance!
Hi @TomVictor ,
I think I was able to replicate the issue in my tests. Can you please try:
Filter(
'CRM - Paramètre Unité' As ParentList;
Not(ParentList.Unité in AddColumns('CRM - Lignes commandes'; "vUnite"; Unite.Value).vUnite)
)
Hi @BCBuizer,
I try and it still not working, "Impossible to convert this type of data", that's what my PowerApps said.
May be it's a problem with my ParentList ?
Hi @TomVictor ,
It seems that the in operator does not like working with complex types. Can you please try this:
Filter(
'CRM - Paramètre Unité';
Not('CRM - Paramètre Unité'. Unité in AddColumns('CRM - Lignes commandes'; "vUnite"; Unite.Value).vUnite)
)
Basically it adds a column to the ChildList with the value of the LookUp column as plain text. This can then be used to filter the ParentList.
Hi @BCBuizer ,
I replace ParentList, ParentColumnName, ChildList and ChildColumn name with their actual name like this :
Filter(
'CRM - Paramètre Unité';
Not(Unité in 'CRM - Lignes commandes'.Unite.Value))
I don't see where is my mistake.
Hi @TomVictor ,
Did you replace ParentList, ParentColumnName, ChildList and ChildColumn name with their actual names?
For clarification on what I'm referring to:
ParentList: The list with the Text type column in it
ParentColumnName: the Text type column
ChildList: The list with the LookUp type column in it
ChildColumnName: The LookUp column
Hi @BCBuizer ,
Thanks for your reply, I have a problem with your first formula, It tells me "Value is not recognised".
How can I fix it ?
Hi @TomVictor ,
To do this in Power Apps, let's call the list with the values the ParentList and the list with the LookUps the ChildList.
Insert a gallery in Power Apps and set its' Items property to:
Filter(
ParentList,
Not(ParentColumnName in ChildList.ChildColumnName.Value)
)
This will display all items in ParentList that don't have a match in ParentColumnName in ChildList.ChildColumnName (which is the LookUp column).
This formula will give you a delegation warning, but as long as you don't have more than 2000 items in ParentList, this is not an issue.
Finally you can choose to add a remove button inside the gallery to be able to delete individual items (OnSelect = Remove(ParentList, ThisItem) ) and/or add a button outside the gallery to remove all items (OnSelect = RemoveIf(ParentList, ID in GalleryName.AllItems.ID) ).
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional