Select to view content in your preferred language

Using Model Builder's inline variable %Date% or %t% in Output name

848
2
Jump to solution
09-06-2023 04:43 PM
VanessaSimps
Frequent Contributor

hello- I am trying to use the inline variable of either %Date% or %t% in an output name. 

VanessaSimps_0-1694043134153.png

I am not using an iterator in this model, I simply want to be able to automat the output name to have the date included in the name. 

I am getting the following messages (000354 if I use %date% and 000278 if I use %t%) , which could make sense if the model isn't actually recognizing the %. 

  • ERROR 000354: The name contains invalid characters
  • ERROR 000278: Field mapping error: field type invalid for output field created_date and input field created_date

Do you have to be utilizing an iterator in your model in order to use the date inline variable?

Thanks in advance,

Vanessa

0 Kudos
1 Solution

Accepted Solutions
SiqiLi
by Esri Contributor
Esri Contributor

Hi @VanessaSimps,

Iterators are not required in order to use inline variable.

%date% is not one of our supported system variables, so it doesn't work. 

%t% should work and add time in the format of YYYYMMDDHHMMSS (inline variable documentation). This "ERROR 000278: Field mapping error: field type invalid for output field created_date and input field created_date" seems related to the Feature Class To Feature Class Tool. Could you please try use Export Features tool? 

 

View solution in original post

2 Replies
SiqiLi
by Esri Contributor
Esri Contributor

Hi @VanessaSimps,

Iterators are not required in order to use inline variable.

%date% is not one of our supported system variables, so it doesn't work. 

%t% should work and add time in the format of YYYYMMDDHHMMSS (inline variable documentation). This "ERROR 000278: Field mapping error: field type invalid for output field created_date and input field created_date" seems related to the Feature Class To Feature Class Tool. Could you please try use Export Features tool? 

 

VanessaSimps
Frequent Contributor

Thank you for the response. I must have mixed up seeing %data% and %date% when I was looking through the documentation yesterday! 

I did a quick test using your suggestion. One test using Export Features with the %t%. And then, just for fun I decided to test it again with the FC to FC this time using %t%. I actually got both to work! 

Thank you for the quick response!