I have an APP that has 2 Screens:
A main Screen and An Edit Screen.
The Main Screen displays all the records in a Gallery. When a user selects a record - I navigate the the edit screen:
Navigate(EditScreen,ScreenTransition.Fade)
On the Edit Screen I have a Form that has the selected record. The users can edit the record and click a Submit button:
SubmitForm(Form1);Navigate(MainScreen,ScreenTransition.Fade)
I would like to put the Form on the EditScreen on the Main screen - so the Application will have only 1 Screen, with 2 Forms.
How do I get this to work?
Here is the Concept:
Additionally, since there will be about 10 records in the Left form - is there a way that the users can know which record they have already edited?
OR, can they edit the records directly in the left Form - without having to launch a second form?
Solved! Go to Solution.
Put the form on the screen below the gallery. No need for a Navigate() function in any of your commands. In the gallery, make the Template fill property If(ThisItem.IsSelected,LightBlue,RGBA(0, 0, 0, 0)). Put the SubmitForm(Form1) button on the screen. You want to set the form's Default mode to Edit. You might also want to put a "+" icon outside the gallery to add a new record. It should have NewForm(Form1) as its OnSelect property.
The Item property of the form should be Gallery1.Selected It will automatically fill when you select an item in the gallery; assuming Gallery1 is the name of your gallery. The ">" icon is unnecessary.
Hi @Canadiansal,
As you said at begining, the left Form is actually a Gallery, right ?
There is no problem to move the Form (the right Form 🙂 ) on the Main Screen along with the submit Button. Don't forget to modify the OnSelect property of the button:
SubmitForm(Form1);Navigate(MainScreen,ScreenTransition.Fade)
If you want to track the edited records, update the Form OnSuccess property with: Collect(editedRecords,Form1.LastSubmit.ID)
Then Insert a label in your gallery with:
Text: "Already modified"
Visible: ThisItem.ID in editedRecord.Value
And you'll see the records already modified in this session.
Hope it helps !
I would like to put the Form on the EditScreen on the Main screen - so the Application will have only 1 Screen, with 2 Forms. How do I get this to work?
Yes just like what you have in your image.
Select everything on the right (form) and group them.
From the gallery on the Right Arrow OnSubmit property:
Set(showEditform,"show"); Set(varID,ThisItem.ID)
Now go back to the right side group (which has the form etc.)
Set the visible property of the group: If(showEditform="show",true,false)
Next on the Form Item property: LookUp(?Source?,ID=varID)
Submit Button on Select property: SubmitForm(?form?); Refresh(?Source?); Set(showEditform,"hide")
Additionally, since there will be about 10 records in the Left form - is there a way that the users can know which record they have already edited?
Ok so everytime when the right arrow is clicked to show the edit form.
You can include onselect property for the arrow :Collect(tempCollection,{AllID: ThisItem.ID})
Next insert an icon as an indicator to change color green vs black to check if the current ID is listed in the tempCollection. If(LookUp(tempCollection,AllID=ThisItem.ID),AllID=ThisItem.ID,Green,Black)
note: The above is for the current session only.
OR, can they edit the records directly in the left Form - without having to launch a second form?
This can be done two ways:
Edit and save (patch) single row
or Edit all rows (Gallery.allitems) and save (patch)
Hi @Canadiansal
I have no idea what these other commenters are talking about, so I'll ignore them. The button to submit the form should not be inside the form or inside the gallery. The datasource of the form should be the same as the datasource of the gallery. The OnSelect property of the button should have the name of the form to submit. Check the name of the form and make sure it is the same as the one you are submitting. This is not a complicated process, stay focused. The picture shows my Contacts list. The Form named Form1, is directly below it. The Items property of the gallery is the same as the datasource of the form. The Item property of the form is Gallery1.Selected. The button's OnSelect property is SubmitForm(Form1). The "+" icon above the gallery has its OnSelect property NewForm(Form1). I assure you that it works perfectly when I tested it.
Put the form on the screen below the gallery. No need for a Navigate() function in any of your commands. In the gallery, make the Template fill property If(ThisItem.IsSelected,LightBlue,RGBA(0, 0, 0, 0)). Put the SubmitForm(Form1) button on the screen. You want to set the form's Default mode to Edit. You might also want to put a "+" icon outside the gallery to add a new record. It should have NewForm(Form1) as its OnSelect property.
So how do I trigger the selection? Currently, I have the Navigate triggered onSelect.
The Item property of the form should be Gallery1.Selected It will automatically fill when you select an item in the gallery; assuming Gallery1 is the name of your gallery. The ">" icon is unnecessary.
Hi @Canadiansal,
As you said at begining, the left Form is actually a Gallery, right ?
There is no problem to move the Form (the right Form 🙂 ) on the Main Screen along with the submit Button. Don't forget to modify the OnSelect property of the button:
SubmitForm(Form1);Navigate(MainScreen,ScreenTransition.Fade)
If you want to track the edited records, update the Form OnSuccess property with: Collect(editedRecords,Form1.LastSubmit.ID)
Then Insert a label in your gallery with:
Text: "Already modified"
Visible: ThisItem.ID in editedRecord.Value
And you'll see the records already modified in this session.
Hope it helps !
This has been helpful - thank you all.
So I have Set this up and the Selection etc is working.
My Issue is that the Submit Button is not writing to the datasource. Does it need to be out of the Form or in?
The Code is: SubmitForm(MainForm)
(I named the Form "Main Form")
My previous arrangement of having a second screen +second Form (Form1) has this on the Submit Button:
SubmitForm(Form1);Navigate(MainScreen,ScreenTransition.Fade)
And this writes to the data source and works as expected. What could I be missing?
I would like to put the Form on the EditScreen on the Main screen - so the Application will have only 1 Screen, with 2 Forms. How do I get this to work?
Yes just like what you have in your image.
Select everything on the right (form) and group them.
From the gallery on the Right Arrow OnSubmit property:
Set(showEditform,"show"); Set(varID,ThisItem.ID)
Now go back to the right side group (which has the form etc.)
Set the visible property of the group: If(showEditform="show",true,false)
Next on the Form Item property: LookUp(?Source?,ID=varID)
Submit Button on Select property: SubmitForm(?form?); Refresh(?Source?); Set(showEditform,"hide")
Additionally, since there will be about 10 records in the Left form - is there a way that the users can know which record they have already edited?
Ok so everytime when the right arrow is clicked to show the edit form.
You can include onselect property for the arrow :Collect(tempCollection,{AllID: ThisItem.ID})
Next insert an icon as an indicator to change color green vs black to check if the current ID is listed in the tempCollection. If(LookUp(tempCollection,AllID=ThisItem.ID),AllID=ThisItem.ID,Green,Black)
note: The above is for the current session only.
OR, can they edit the records directly in the left Form - without having to launch a second form?
This can be done two ways:
Edit and save (patch) single row
or Edit all rows (Gallery.allitems) and save (patch)
Hi @Canadiansal
I have no idea what these other commenters are talking about, so I'll ignore them. The button to submit the form should not be inside the form or inside the gallery. The datasource of the form should be the same as the datasource of the gallery. The OnSelect property of the button should have the name of the form to submit. Check the name of the form and make sure it is the same as the one you are submitting. This is not a complicated process, stay focused. The picture shows my Contacts list. The Form named Form1, is directly below it. The Items property of the gallery is the same as the datasource of the form. The Item property of the form is Gallery1.Selected. The button's OnSelect property is SubmitForm(Form1). The "+" icon above the gallery has its OnSelect property NewForm(Form1). I assure you that it works perfectly when I tested it.
This seems very straightforward - yet, I am running into an issue. The Submit button is not writing to the database. I have copied the same code from my second screen(Which I plan to delete). The Second Screen works as expected and writes to the database. Any ideas where I might be missing a setting?
Second Screen works as expected:
So I got it to work, but its editing the record, not adding a new one. I would like to keep the original record and create a copy when the user hits submit.
User | Count |
---|---|
184 | |
123 | |
90 | |
46 | |
42 |
User | Count |
---|---|
268 | |
160 | |
129 | |
82 | |
76 |