Hi
I have a patch statement where it creates new records in my dataverse table. The problem is if my Components table field Komponento pavadinimas contains duplicate values(same Component name for different projects) So if i patch component name lets say 001 and asign it to project Project2 with patch it will assign this 001 to Project1 if Project1 has this component with same name. My questions is how to correctly use patch and assign this component with duplicate name(thow it is a separate record) to correct project?
Maybe @RandyHayes you have a solution for that?
Patch(Transactions,
ForAll(
Filter(Gallery1.AllItems,Checkbox1.Checked) As gTable ,
{
new_qty:Value(gTable.TextBox1.Value),
new_transactiondate:DateOperacijosData.Value,
new_Employeecode:LookUp(Employees,'Darbuotojo kodas'=FilterDarbuotojasCard.Selected.'Darbuotojo kodas'),
new_Projectname:LookUp(Projects,'Projekto pavadinimas'=FilterProjektoNuorodaCard.Selected.'Projekto pavadinimas'),
new_Stagename:LookUp(Stages,'Darbo pavadinimas'=FilterDarboTipasCard.Selected.'Darbo pavadinimas'),
new_Componentname:LookUp(Components,'Komponento pavadinimas'=gTable.'Komponento pavadinimas')
}
)
);
Solved! Go to Solution.
Hi @rampprakash
I actually found the correct way how to do that in case when patching a lookup field that has multiple same Name values in dataverse
Dataverse allows to patch lookup field by it's unique identifier so what i did is:
new_Componentname:LookUp(Components,Components=gTable.Components)
And it did the trick. Now it creates records and assigns accordingly
Hello @jja
Hope you are doing good,
Can you please make sure below query returning only one values
LookUp(Employees,'Darbuotojo kodas'=FilterDarbuotojasCard.Selected.'Darbuotojo kodas')
Hi @rampprakash
I actually found the correct way how to do that in case when patching a lookup field that has multiple same Name values in dataverse
Dataverse allows to patch lookup field by it's unique identifier so what i did is:
new_Componentname:LookUp(Components,Components=gTable.Components)
And it did the trick. Now it creates records and assigns accordingly
User | Count |
---|---|
20 | |
11 | |
9 | |
5 | |
5 |
User | Count |
---|---|
34 | |
32 | |
19 | |
18 | |
7 |