Dear All,
I'm struggling with a problem of create and edit records based on a gallery item.
Let me try to explain.
1. I've created an overview screen with a gallery and a button to add a new record outside the gallery. (attachment Capture1.png)
2. On the add button, I want to open an edit screen to create a new record. So on the OnSelect, I have put the following statement : Navigate('EditCreate Screen',ScreenTransition.None)
3. This opens a data entry screen with two text input controls where i can enter data and save it to a collection that will be shown in the gallery i've mentioned in step 1. (attachment Capture2.png)
OnSelect of the save button, I've added the following code : Collect(
colOverview,
{
WorkDescription: TxtCountDrives_1.Text,
BudgetNo: txtBudgetNo_1.Text
}
);
Navigate(
'Overview Screen',
None
)
4. This will add a record in the gallery as expected (attachment Capture3.png)
5. The next step i want to achieve is that when someone presses the pencil, the record is shown in the 'EditCreate Screen', so the user has the possibility to change the data and update the collection.
PS I'm not using data forms.
I'm not achieving to create a solution form step 5 and to get the difference to populate the fields with the value from a record of the collection and to show a blank screen when the screen is opened from the Add button.
I hope someone can help me.
Kind regards
Steve
Hi @Desmedts
Well done, app is looking very good so far.
What is the formula that you have tried on the pencil icon? What part of the pencil icon isn't working?
You should be able to use something like below:
Set(Form_Edit,true);
Navigate('EditCreate Screen',ScreenTransition.None)
You would then have to set the default formula for the text input controls to be:
If(Form_Edit, homeGallery.Selected.Fieldname, "")
To save the record back to the collection:
Patch(colOverview,homeGallery.Selected,{WorkDescription: TxtCountDrives_1.Text,BudgetNo: txtBudgetNo_1.Text});
Set(Form_Edit,false);
Navigate('Overview Screen',None)
A form could also help quite a bit here, they can make your live easier in some instances.
Please let me know if you don't come right.
Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
206 | |
97 | |
60 | |
51 | |
45 |
User | Count |
---|---|
257 | |
158 | |
85 | |
79 | |
58 |