How to specify value of key at run time

@ashwini.mali find the below attachment

Json.zip (1.8 KB)

let me know if you have any queries on this workflow.

Here I am putting some default values , you can provide your excel column values to create dynamically.

thank you for replay
Please tell me where you create variable( JsonObject ), Which is ued in Assign Activity
JsonObject(“”)=Value

Check in variable pannel, where I have created and initialize that

let me know , if still your are getting errors

hii
As You Told me ,Using Multi Assign Activity to assign value to key but Getting Error .
Kindly Checked Attach Image (error)

Have you initialized jobj in your workflow

Thank You ,Error solved

1 Like

Thank you so much @ashwini.mali happy learning…please mark this to solved so that other can get help of this…

Hii
Error is solved but When i add Http request Activity to call rest api Post method ,
getting Status code 500
Please Guide me how to resolve

I see, you are passing string in the body property. Do this

  1. After creating the jsonArray , deserialized it by using deserializedjson activity then pass the varialbe to the body property of httprequest activty


But Still not solved

only send the variable:

write : JsonBody , remove double quotes

Remove variable ,getting error

Write JsonBody.ToString

updated,but still same error
<ob:error xmlns:ob=“http://www.openbravo.com”>java.lang.NullPointerException
Caused by: null</ob:error>

Response Status: Completed
Status Code: 500
Content-Type

print your JsonBody.ToString in a writeline activity and check the values are printing properly or not

I think some values are coming null

image

also change the body format to application/json

Issue Resolve
Thank You

1 Like

Great work. Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.