cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dewitjin
Level: Power Up

Order of data card - DateTime card failing to submit/update properly

I have a form called formProjectContract, connected to a table in my SQL database called projectContract table.  One of the field is failing to submit properly (when I change it's x and y coordinates).  The field that fails to submit is a date field.  This field is updating a date (not datetime), null field.  When I try to submit the form with a date selected from datepicker calendar, the form submits successfully; however, nothing is inserted for that field in the table (the rest of the fields are properly inserted though).

To fix, I insert a new field with the same field source (called contractProjectClose).  This works.  When I insert a new field, the datacard is appended to the very end of the form.  It works when I leave the location at the end of all other datacards.  I want to move it to the first column of the form though. After moving, saving and publishing, the new datacard is broken again.

Can moving a datacard in front of all the older one break a link???

3 REPLIES 3
Super User
Super User

Re: Order of data card - DateTime card failing to submit/update properly

Hi @dewitjin,

Did you delete the old card?  If not, that could be the source of the problem. 

Community Support Team
Community Support Team

Re: Order of data card - DateTime card failing to submit/update properly

Hi @dewitjin,

Do you change the Order of Date Time field within your Edit form?

How do you change the Order of the Date Time field within your Edit form?

I have made a test on my side, and don't have the issue that you mentioned. Please check if you have selected proper value within the Date Time field.

In addition, you could also consider take a try to submit your form data using Patch function instead of SubmitForm function. The formula format of the Patch function as below:

Patch(
   'YourSQLTable',
    Defaults('YourSQLTable'),
    {
      Column1: DataCardValue1.Text,
      Column2: DataCardValue2.Text,
      ...
      DateColumn: DateCardValue6.SelectedDate,
      ...
    }
)

On your side, you should type the following formula within the OnSelect property of the "Submit" button:

If(
  EditForm1.Mode= FormMode.New,
  Patch(
   'YourSQLTable',
    Defaults('YourSQLTable'),
    {
      Column1: DataCardValue1.Text,
      Column2: DataCardValue2.Text,
      ...
      DateColumn: DateCardValue6.SelectedDate,
      ...
    }
),
 Patch(
   'YourSQLTable',
    BrowserGallery1.Selected,
    {
      Column1: DataCardValue1.Text,
      Column2: DataCardValue2.Text,
      ...
      DateColumn: DateCardValue6.SelectedDate,
      ...
    }
)
)

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dewitjin
Level: Power Up

Re: Order of data card - DateTime card failing to submit/update properly

The first thing I did was add the new card, and then delete the old card.  Data was being sent in edit mode so I published the app.  But then my users told me that the field wasn't actually updating the data again.

 

I know how to patch data but I am trying to avoid it.  I have one form and I use one submit button to send data.  I don't want to have to use the submit action for other fields and then have to patch the one field that is not being sent.

 

Any more ideas?