Use Rest API to create record.

ShuangChang
Tera Contributor

Hi All,
I want to create a record in another instance using rest message.
and I created a flow action to post the information when conditions are met.
I can create the record through this action, but the datetime field can not be updated.

ShuangChang_1-1744348436867.png

 


ShuangChang_0-1744348378766.png

Could you please help to find the problem?
Thanks a lot.

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@ShuangChang 

is that date/time or date type of field?

Are you sure you are passing the correct values?

are you sure the input value is correct?

share the logs by adding gs.info(inputs.startTime) and gs.info(inputs.endTime)

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes it is date time field.
I change the code like below, and it works in my pdi .but it doesn't work in my customer7s instance.

ShuangChang_0-1744356941781.png

 

@ShuangChang 

any script is clearing the fields?

what error do you get?

share the logs by adding gs.info(inputs.startTime) and gs.info(inputs.endTime)

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

GopikaP
Mega Sage

Hi @ShuangChang , in which format are you passing the datetime field in the flow designer? 

Are you passing in this format - 

2025-04-11 05:37:19

If not, it will not get updated. Please log the values and see.