web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Only send the first it...
Power Apps
Answered

Only send the first item in my collection to my sharepoint list

(0) ShareShare
ReportReport
Posted on by 98

 

Hi all,
I need help sending only the first item in my collection to my sharepoint list.

The formula I'm using is
ForAll (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
}))

however in my collection there are more than 1 client and I only wanted the first one.

Can anyone guide me?

Categories:
I have the same question (0)
  • newk1991 Profile Picture
    91 on at

    Patch (Customer_Dev_List; Defaults (Customer_Dev_List);
    {code: First(CustomerDisplays).COD_CLIENTE;
    Title: First(CustomerDisplays).RAZAO_SOCIAL;
    store: First(CustomerDisplays).LOJA_CLIENTE;
    address: First(CustomerDisplays).ENDERECO_CLIENTE;
    municipality: First(CustomerDisplays).MUNICIPIO_CLIENTE;
    state: First(CustomerDisplays).ESTADO_CLIENTE;
    tipofrete: First(CustomerDisplays).TIPO_FRETE;
    codtransp: First(CustomerDisplays).COD_TRANSPORTADORA;
    transp: First(CustomerDisplays).NAME_TRANSPORTADORA;
    valornf: First(CustomerDisplays).VALOR_BRUTO_NFE;
    note: First(CustomerDisplays).NOTE;
    serie: First(CustomerDisplays).SERIE;
    IdDev: FormDevolucao.LastSubmit.ID
    })

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard