How to get the Headers Value from json response

@HareeshMR

Happy to see the response!!!

1 Like

How to get the specific value from the dictionary ? I am trying… DO I have to read it to List?? or I have to write it to a DataTable

Happy to hear that @me.mohanraj,

And you will get the value from dictionary as : DictionaryName(“Key Name”).ToString

@HareeshMR

Many Thanks… :slight_smile: I made it…

@HareeshMR, Hi… Morning…
I have doubt in Add Data Row… Can you help me out …

Hi @me.mohanraj,

Yes please…

The GetDataRow is inside a IF else Statement (above screen)

There are two GetDataRow in two separate if else …

When I run my code , I get the excel written as

My Build DataTable Screen:
image

Status should be written in Status of DUNS column

1 Like

Can you please post the screenshots of how you are giving the inputs to Add Data Row in both the scenarios?

You are using two different activities, so it is adding two rows. The better way is store two values in two variables everytime, so after the loop completion, you have two values, so you can use one Add row data activity with those two variables as {value1, value2}… so that the values will be added in a single row.

Please let me know if you still have doubts bro…

Sure Hareesh, Will try that… and let you know… :slight_smile:

1 Like

Hi Hareesh,
Can you please guide me regarding the “POST” method.
How to place the BODY and manipulate the body value by the Variables…
Totally how to use the POST method.

Thanks…
“Hope I am eating more of your TIME”… :

Please refer this post … It has entire details you need

(Not at all… Happy to help :blush:)

Can I get this as a XMAL file… unable to open the ZIP in my company… I tried.

PassingJsonStringFromAssign.xaml (4.7 KB) project.json (735 Bytes)

Download these two and place in a same folder and try to open

Is it working @me.mohanraj?

You need to pass the body in a single line as a string.

I am building that Single line @HareeshMR

Sample:

{“”““tcms:CreateMonitoringProfileRequest””:{““MonitoringProfileDetail””:{““ProfileName””:““Qa””,““ProfileDescription””:““Q””,““UserId””:““qateam””,““EmailType””:“”“”,““FilterID””:““116"”,”“FilterName”“:”“AlertFilter_June06_01"”,““CustDsn””:““RioQADSN””,““CountryISOAlpha2Code””:““US””,““LanguagePreferenceCode””:““39"”,”“ProfileId”“:null},”“ChangeEventDetails”“:[{”“RulesDetail”“:[{”“id”“:”“293"”,““AttributeName””:““Change Of Failure Score Percentile””,““ChangeCondition””:““ValueGoesBeyond””,““ChangeValue””:““69"”,”“ChangeNotificationIndicator”“:0,”“RuleId”“:0,”“parentScotsCd”“:”“17893"”,““scotsCd””:““17893"”},{”“id”“:”“178"”,

All the " shou
ld be changed to “” right ???

Can you post the body you are posting in postman?

My Postman Req:
{
“tcms:CreateViewingProfileRequest”:{
“ViewingProfileDetail”:{
“ProfileName”:“Qa”,
“ProfileDescription”:“Q”,
“UserId”:“qateam”,
“EmailType”:“”,
“FilterID”:“116”,
“FilterName”:“Filter_June06_01”,
“CustDsn”:“RioQADSDASN”,
“CountryISOAlpha2Code”:“US”,
“LanguagePreferenceCode”:“39”,
“ProfileId”:null
},
“ChangeEventDetails”:[
{
“RulesDetail”:[
{
“id”:“293”,
“AttributeName”:“Change of Percentile”,
“ChangeCondition”:“ValueGoesBeyond”,
“ChangeValue”:“69”,
“ChangeNotificationIndicator”:0,
“RuleId”:0,
“parentScotsCd”:“17893”,
“scotsCd”:“17893”
},
{
“id”:“178”,
“AttributeName”:“High Risk”,
“ChangeCondition”:“”,
“ChangeValue”:0,
“ChangeNotificationIndicator”:1,
“RuleId”:0,
“parentScotsCd”:“18689”,
“scotsCd”:“19880”
},
{
“id”:“179”,
“AttributeName”:“Information Alert”,
“ChangeCondition”:“”,
“ChangeValue”:0,
“ChangeNotificationIndicator”:1,
“RuleId”:0,
“parentScotsCd”:“18689”,
“scotsCd”:“18689”
}
]
}
],
“NotificationDetails”:[
{
emailId":"mike@dnb.com
}
]
}
}

Here are the steps you have to do:

  1. Replace Double quotes (") with single quote (')
  2. Pass it as " JSON "…
  3. Make sure the entire JSON is in single line.

This is the req as string in single line :slight_smile:“{‘tcms:CreateMonitoringProfileRequest’:{‘MonitoringProfileDetail’:{‘ProfileName’:‘Qa’,‘ProfileDescription’:‘Q’,‘UserId’:‘qateam’,‘EmailType’:‘’,‘FilterID’:‘116’,‘FilterName’:‘AlertFilter_June06_01’,‘CustDsn’:‘RioQADSN’,‘CountryISOAlpha2Code’:‘US’,‘LanguagePreferenceCode’:‘39’,‘ProfileId’:null},‘ChangeEventDetails’:[{‘RulesDetail’:[{‘id’:‘293’,‘AttributeName’:‘Change Of Failure Score Percentile’,‘ChangeCondition’:‘ValueGoesBeyond’,‘ChangeValue’:‘69’,‘ChangeNotificationIndicator’:0,‘RuleId’:0,‘parentScotsCd’:‘17893’,‘scotsCd’:‘17893’},{‘id’:‘178’,‘AttributeName’:‘High Risk’,‘ChangeCondition’:‘’,‘ChangeValue’:0,‘ChangeNotificationIndicator’:1,‘RuleId’:0,‘parentScotsCd’:‘18689’,‘scotsCd’:‘19880’},{‘id’:‘179’,‘AttributeName’:‘Information Alert’,‘ChangeCondition’:‘’,‘ChangeValue’:0,‘ChangeNotificationIndicator’:1,‘RuleId’:0,‘parentScotsCd’:‘18689’,‘scotsCd’:‘18689’}]}],‘NotificationDetails’:[{‘emailId’:‘mike@dnb.com’}]}}”

But When I hit I get 415 as status code.

I have selected the method as “POST”
Accept Format " JSON
BODY Format as : application/json
Given Endpoint URL… DO I miss anything ???

I hope you are missing some headers.

You need to pass Content-Type header with value application/JSON …

And Accept as application/Json …

Are you sure you are passing all the inputs you are passing in postman?