Hi@beatrizmoura26,
Based on the issue that you mentioned, do you want to patch the first record of the collection to your SP list?
Could you please share a bit more about the scenario?
Let me make it easy for you. The ForAll() function will operate all the collection rather than a certain record. Also, the Patch() formula you wrote will surely patch all the collection.
If you just want to patch the first record of your collection, you could try to collect the first records within the collection to a new collection.
I have a test on my side, please take a try as below.
Collect the first item of the previous collection to a new collection.
ForAll (
Collect(Col,First(CustomerDisplays)),
Patch (
Customer_Dev_List,
Defaults (Customer_Dev_List),
{
code: COD_CLIENTE,
Title: RAZAO_SOCIAL
}
)
)
Note: The new collection that stores the first item of your 'CustomerDisplays' collection is named 'Col'. For convenience, I just test for two fields, you could replace it with yours.
You could modify your formula as below:
ForAll (Collect(Col,First(CustomerDisplays)); Patch (Customer_Dev_List; Defaults (Customer_Dev_List);
{code: COD_CLIENTE;
Title: RAZAO_SOCIAL;
store: LOJA_CLIENTE;
address: ENDERECO_CLIENTE;
municipality: MUNICIPIO_CLIENTE;
state: ESTADO_CLIENTE;
tipofrete: TIPO_FRETE;
codtransp: COD_TRANSPORTADORA;
transp: NAME_TRANSPORTADORA;
valornf: VALOR_BRUTO_NFE;
note: NOTE;
serie: SERIE;
IdDev: FormDevolucao.LastSubmit.ID
}))
Best Regards,
Qi