Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Save collection to Dataverse Table saves null

(0) ShareShare
ReportReport
Posted on by 18

I'm trying to save a collection (called: artikelen) to a dataverse table (called: orderregels) by using the Patch function.

 

My collection has the following columns:

artikel

fabrikant

 

My Dataverse table has the following columns:

artikelnaam

fabri

And of course the default columns

 

I give a button the following formula:

 

ForAll( artikelen;
Patch('orderregels';

Defaults('orderregels');

{ artikelnaam: artikel ;
fabri: fabrikant
}
)
)

 

the problem is There is a new record created in the DataVerse table but the artikelnaam and fabri are empty (null)

I tried very many like artikelen(@artikel] but nothing seems to work. 

Please can anybody give me the solution?

 

thnx!

Erik

 

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Save collection to Dataverse Table saves null

    @Goerami 

    Happy to help!!

  • Goerami Profile Picture
    18 on at
    Re: Save collection to Dataverse Table saves null

    @RandyHayes I found what I did wrong. I forgot to refresh the Dataverse table. Now it works. Many many many thanks!!!

  • Goerami Profile Picture
    18 on at
    Re: Save collection to Dataverse Table saves null

    @RandyHayes 

    WOW! thnx! now I can see the items I added in the collection, but, now the formula to save the collection to the dataverse table gives an error. Powerapps say it expect a record and not a table :S 

     

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Save collection to Dataverse Table saves null

    @Goerami 

    Yep...there is the issue.  You are assigning complete controls to the record, not the property of the control that you want.

    I noticed in your last screenshot that the formula editor was showing "Besteuringselement" for the data in those columns.  

     

    You need to reference the property of the control that you want.  So your formula will become:

    Collect(artikelen;

     {

      artikel:txt_neworder2_artikel.Text;

      fabrikant:txt_neworder2_fabrikant.Text;

      ...etc..

     

    Otherwise, you are trying to set the column to a complete control.  And then when you try to write that to your table...it has no idea what it is.

     

  • Goerami Profile Picture
    18 on at
    Re: Save collection to Dataverse Table saves null

    This is the formula and attached the canvas app :

     

    Collect(artikelen;

    {

    artikel:txt_neworder2_artikel;

    fabrikant:txt_neworder2_fabrikant;

    type:txt_neworder2_type;

    maatl:txt_neworder2_maatl;

    maatb:txt_neworder2_maatb;

    aantal:txt_neworder2_aantal;

    prijs:txt_neworder2_prijs;

    korting:txt_neworder2_korting;

    gereserveerd:chkbox_neworder2_gereserveerd;

    gratis:chkbox_neworder2_gratis;

    opmerking:txt_neworder2_opmerking

    }

    )

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Save collection to Dataverse Table saves null

    @Goerami 

    What is the formula you are using to put those two columns (and possibly others) into your collection? 

  • Goerami Profile Picture
    18 on at
    Re: Save collection to Dataverse Table saves null

    hi @RandyHayes 

    I checked it and there is something in it. But i can't see what .  I have made a gallery and connected the collection to it. In the gallery I can see everything I added to the collection.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Save collection to Dataverse Table saves null

    @Goerami 

    I would double check your collection then too and make sure there is data in it as you expect.

    You can look at the contents of it in your formula by clicking on the collection name and then expanding the data viewer at the bottom of the formula editor.

  • Goerami Profile Picture
    18 on at
    Re: Save collection to Dataverse Table saves null

    Hi @RandyHayes ,

    Fabri and artikelnaam are text columns

    artikel and fabrikant in the collection are text columns too (i think, because I don't know where I can check that). The fields in my canvas app are text format.

     

    I have attached a screenshot of my Dataverse table where you can see the artikelnaam and fabri column.

     

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Save collection to Dataverse Table saves null

    @Goerami 

    Okay...the formula is now correct.  There is something else at play here.

    What kind of columns are fabri and artikelnaam in your dataverse table?

    Also, are they the same type of columns in your collection...and does your collection actually have them in?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1