Hi @anubha007
I am confused on part one but let me start with part 2
For Part 2.
For the Data Fields for Dates, it tells me the Default values for these are not set and therefore blank. please take a picture of the DefaultDate Property, I bet its blank. That or your Filter or Query for getting the data is not including these.
For Part 1.
You said
I have created a Canvas app for our campaigns. I need help with having view and edit buttons for all the submitted forms instead of having an individual, as it has messed up the design
I believe what you are asking for is a Single Button outside of the Gallery, that as long as you have a row selected, you want them to be able to click View or Edit and it goes to the form.
So the Code you already have in your buttons, would be exactly (unless you wrote something weird), as it would be outside.
Please provide details on how you are getting to the Edit or View Form. Are you passing the Entire Row or just a Row Idea. Are the Forms DataSource the same as the Gallery? What is the Expression in the Item property
From outside in a Button I would do
OnSelect
Navigate(MyViewOrEditScreen, Transition.None, {_RowId: GalleryName.Selected.RowId })
I am assuming you have some row id that can be filtered on.
That or you can pass the whole record
Navigate(MyViewOrEditScreen, Transition.None, {_Row: GalleryName.Selected})
Now in the Item Property you either do
LookUp(DataSource, RowId = _RowId)
Or
_Row if you passed the row
Thats all there is too it 🙂
P.S. if you are using the same screen for the View or Edit then you can adapt what I said and do this
Navigate(MyViewOrEditScreen, Transition.None, {_RowId: GalleryName.Selected.RowId, _FormMode: "VieworEditGoeshere" })
I am assuming you have some row id that can be filtered on.
That or you can pass the whole record
Navigate(MyViewOrEditScreen, Transition.None, {_Row: GalleryName.Selected, _FormMode: "VieworEditHere"})
Now in the Item Property you either do
LookUp(DataSource, RowId = _RowId)
Or
_Row if you passed the row
Thats all there is too it :-)
Forms, DefaultMode property
Switch(_FormMode,
"View",
FormMode.View,
"Edit",
FormMode.Edit
);
This way you are passing Context Variables to your Screens and not Global Variables or accessing the Gallery from Another Screen.
Nice... and... Clean...
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey