cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LindsayFairy
Level: Powered On

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
Highlighted
Community Support Team
Community Support Team

Re: Create new line/box in gallery

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

LindsayFairy
Level: Powered On

Re: Create new line/box in gallery

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
Community Support Team
Community Support Team

Re: Create new line/box in gallery

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.
LindsayFairy
Level: Powered On

Re: Create new line/box in gallery

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

Community Support Team
Community Support Team

Re: Create new line/box in gallery

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.
LindsayFairy
Level: Powered On

Re: Create new line/box in gallery

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 

Highlighted
Community Support Team
Community Support Team

Re: Create new line/box in gallery

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

Administrator
Administrator

Re: Create new line/box in gallery

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

 

@TopShelf-MSFT

LindsayFairy
Level: Powered On

Re: Create new line/box in gallery

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 177 members 6,039 guests
Please welcome our newest community members: