cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LindsayFairy
Frequent Visitor

Create new line/box in gallery

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

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @LindsayFairy,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi Everyone

 

Thanks for all of your replies and help.

 

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

 

Thank you

View solution in original post

7 REPLIES 7
v-xida-msft
Community Support
Community Support

Hi @LindsayFairy,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Hi @LindsayFairy,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 

Hi @LindsayFairy,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

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

 

@Anonymous

Hi Everyone

 

Thanks for all of your replies and help.

 

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

 

Thank you

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,065)