Hi,
I have a gallery that's getting data from a SQL data source.
In my gallery there are three columns, Project, Period and value.
I have a button that adds a new row to my table based on what project is selected in another gallery.
I would like to also add period automatically so that the user does not have to fill this in. What I would like is whatever period is the greatest, then when onselect button, it adds the next row with the next period.
My code is the following.
Gallery:
Sort(Filter('[dbo].[Table]',
ProjectID = SelProj,),
Period,
Descending)
Button to add new row:
Patch(
'[dbo].[Table]',
Defaults('[dbo].[Table]'),
{
ProjectID:SelProj,
}
)
I'm guessing something should be added to the last code snippet, but not sure how.
My period column is in text format "YYYYMM", but I have created a datacolumn as well, in case that is needed.
Really appreciate any help!