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
Solved! Go to Solution.
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
Hi Everyone
Thanks for all of your replies and help.
I managed a work around patching data from my sharepoint list.
Thank you
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:
Best regards,
Kris
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
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
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
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
259 | |
122 | |
85 | |
81 | |
70 |