Flow Action error(cannot read property "id" from undefined,Detail: Cannot read property "id")

Kri
Tera Guru

I'm getting the flow action error while running and also I can't able to publish the flow

Kri_0-1756986471099.png

 

Kri_1-1756986490741.png



I filled the details for the required field though I get this error. I can't able to debug where it goes wrong. Could someone help?

Kri_2-1756986574690.png



Kri_3-1756986602200.pngKri_4-1756986627368.png



Kri_5-1756986686756.png



Kri_6-1756986748673.png



Kri_7-1756986769963.png



Kri_8-1756986791899.pngKri_9-1756986809348.pngKri_10-1756986827373.png

 




1 ACCEPTED SOLUTION

@Kri 

both name and description are string type.

Why are you storing JSON string in it from script step?

1st script step is not required.

Simply use the name and description directly from input in REST Step.

Seems since you are converting string to JSON string and then using REST Step body, it's failing with 400.

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

View solution in original post

9 REPLIES 9

@Kri 

so the above confirms what I said.

Issue is with the script step failing because of that json key not available

did you add log and see what came in response body OR you can check the previous step output and it will tell you the responsebody

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

The previous step response body receives the error as 

Kri_1-1756990275589.png

 

 

 

@Kri 

so the REST Step has error with 400.

It means bad request.

Something is not passed properly in the API request and hence it's failing.

Because REST Step is failing you are not getting any response body and hence JSON parsing fails.

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

not sure. while I test Rest step I was getting 200 status code

Kri_0-1756992704175.png

 

@Kri 

both name and description are string type.

Why are you storing JSON string in it from script step?

1st script step is not required.

Simply use the name and description directly from input in REST Step.

Seems since you are converting string to JSON string and then using REST Step body, it's failing with 400.

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