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 / Create new line/box in...
Power Apps
Answered

Create new line/box in gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

 

I have a gallery and a form that contains input boxes.

 

I am trying to copy each new entry from the input boxes to a new line in the gallery.  The code I have so far is

 

"UpdateContext(Patch(Table1_7,Defaults(Table1_7),{BATCH:BatchDataCard.Text},{AMOUNT:TotalAmountDataCard.Text}));Navigate(EnterTestItemDetails_2,ScreenTransition.Fade)"

 

but this only copies over the most recent entries from the input boxes.

 

The code I had in the gallery text box was 

 

"TEST MATERIAL : " & TestMaterialDataCard"

 

I shall be grateful if anyone can help me create a new 'box' in the gallery with the most recent entry while the previous entries are list as well.

 

Thanks

 

Lindsay

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Could you please share a bit more about your scenario?

    Do you want to copy the submitted record into your Gallery when one new entry is submitted/patched within the Edit form of your app?

    Could you please share a bit more about the TestMaterialDataCard that you mentioned?

    Based on the formula that you provided, I think there is something wrong with it. The UpdateContext function is used to initialize a context variable (e.g. BATCH, AMOUNT, etc) within an app. But on your side, once one new entry is submitted in your Edit form, the corresponding context variable would be updated. So within your Gallery, it could only display the latest submitted entry.

    As an alternative solution, please take a try with the following workaround:

    Set the OnVisible property of the first screen of your app to following:

    ClearCollect(RecordsCollection, Table1_7)

    Within the Edit/New screen, set the OnSelect property of the "Submit" button to following:

    Patch(
    Table1_7,
    Defaults(Table1_7),
    {
    BATCH:BatchDataCard.Text,
    AMOUNT:TotalAmountDataCard.Text
    }
    );
    ClearCollect(RecordsCollection, Table1_7);
    Navigate(EnterTestItemDetails_2,ScreenTransition.Fade)

    Set the Items property of the Gallery control to following:

    RecordsCollection

    Then if you want to reference the property within the RecordsCollection in your Gallery, you could use the following formula:

    ThisItem.ColumnName

    More details about the Patch function in PowerApps, please check the following article:

    Patch function

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Kris

     

    Thank you for your prmpt reply.  

     

    I have attached screen shots to try and show what I am trying to achive.

     

    I shall be most grateful if you can provide any help!

     

    I look forward to hearing from you.

     

    Many thanks

     

    Lindsay

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Have you taken a try with the solution I provided above?

    Based on the needs that you need, I think the solution I provided could achieve your needs.

    Please take a try with the solution I provided above, then check if the issue is solved.

    If the issue is solved, please go ahead to click "Accept as solution" to identify this thread has been solved.

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Kris

     

    I am having trouble with this step:

     

    Then if you want to reference the property within the RecordsCollection in your Gallery, you could use the following formula:

    ThisItem.ColumnName

    Can you please provide more information as I cannot find the property within the RecordsCollection?

     

    Many thanks

     

    Lindsay 

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    I think you have some misunderstanding with the ColumnName property. The ColumnName property is just an sample column.

    On your side, you could get actual column name/property name when you reference property value from the RecordsCollection via property selector (.). e.g. There is a column called TaskName within your RecordsCollection, you could reference it using the following formula:

    ThisItem.TaskName

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous thank you for your post. Can you review the latest reply and advise if it solves your problem?

     

    @Anonymous

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Everyone

     

    Thanks for all of your replies and help.

     

    I managed a work around patching data from my sharepoint list.

     

    Thank you

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard