Hi friends. I'm starting and motivated with powerapps few days ago but now I'm stuck:
I have a Dropdown(Items):
Distinct(Sort(colListaProcedimientos;nListaProcedimineto);nListaProcedimineto)
And a ComboBox(Items) with multiple select:
Puestos.Puesto
I got that values from another lists and I want to insert in another List('Procedimientos') but I don't want duplicated records.
So for example:
List('Procedimientos'):
colA _|_ colB
hello world
hello daddy
Insert: hello(from dropDown), world,Jenny(from comboBox)
Would be fail for world but for Jenny would be pass:
colA _|_ colB
hello world
hello daddy
hello Jenny
I'm trying this but don't works:
Set(item;First(Filter(Procedimientos;Procedimiento in comboBoxPuestos.SelectedItems.Puesto;nombrePuesto in Dropdown1.Selected.Result)));; Patch(Procedimientos;item;{Procedimiento: Dropdown1.Selected.Result; nombrePuesto: comboBoxPuestos.Selected.Puesto})
Any ideas are welcome.
Solved! Go to Solution.
Hi @Charlyvil
Hi @Charlyvil
ForAll( ComboBox1.SelectedItems; If( CountRows( Filter( Procedimientos; ColB = Puesto && ColA = Dropdown1.Selected.Value ) ) = 0; Patch( Procedimientos; Defaults(Procedimientos); { ColA: Dropdown1.Selected.Value; ColB: Puesto } ) ) )
Deleting this because the above solution is FAR more efficient!
Hey @Charlyvil
Were you able to resolve?
Hey @Hooze
Thank you for the comment, but I believe you should not have deleted your suggestion (it could give another perspective for everyone here to approach a problem-solution).
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
I suppose that is true.
Here is the solution I'd thought up, which I hope may be a helpful method or avenue of thought in other situations.
ClearCollect(DupCheck, AddColumns('Procedimientos', "DupFormat", Concatenate(Text(ColA),Text(ColB)))); Forall(ComboBox1.SelectedItems If(Not(Concatenate(Text(Dropdown1.Selected.Value),Text(Puesto)) in DupCheck.DupFormat), Collect('Procedimientos', {ColA: Dropdown1.Selected.Value, ColB: Puesto})))
Hi and thanks for your solutions. I adapt the formula but don't works :
ForAll(comboBoxPuestos.SelectedItems; If( CountRows( Filter( Procedimientos; nombrePuesto = Puesto && Procedimiento = Dropdown1.Selected.Result ) )=0; Patch(Procedimientos; Defaults(Procedimientos); { Procedimiento:Dropdown1.Selected.Result; nombrePuesto: Puesto } ) ) )
But I got duplicates sometimes and I don't know why:
It's more frecuent in multiple selection.
I appreciate any contribution.
Hi @Charlyvil
I'm still having repetitions . Your solution looks good, but I don't know what happen.
Do you have another recomendation to save the data. I only want the relation of two tables. (I was thinking on only one table and one cell have multiple values and then in powerapps split the information, but don't know if it's possible).
Hi @Charlyvil
User | Count |
---|---|
140 | |
132 | |
79 | |
75 | |
74 |
User | Count |
---|---|
210 | |
197 | |
70 | |
66 | |
55 |