Add Features Date Field
I am trying to use the add features tool to input a record for a feature service. However the date is not being added to a date field I have setup. I am using the Create Feature activity with the Add Features activity. Below is the string I am inputting for attributes. Can anyone help me understand how to format the date text to input into a date field?
I have attempted:
={'TDate':$formTransaction.state.dateAdded.value.tostring}
and
={'TDate':$formTransaction.state.dateAdded.display}
I have also attempted the following but it causes an error:
={'TDate':$formTransaction.state.dateAdded.value}
-
The difference a comma makes...
I found that the display command on the date value adds a comma that is not accepted by an esri date field. So workflow was providing the value "5/10/2018, 12:00:49 PM" but an esri date field only accepts the value "5/10/2018 12:00:49 PM" (notice no comma in the second value).
So the correct command is to remove the comma from that value as shown below:
$formTransaction.state.dateAdded.value.display.replace(',','')
0 -
Wow, that's quite the impact for one character.
I took a look at one of my older workflows I'd set up with a date picker and found that I used this for a date attribute:
$displayform1.state.datePicker1.value.value
If you wanted to eliminate the extra step with the replace, you could check if that one works as well on your end.
0 -
That works too! Thanks for the tip!
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare