How to get the Headers Value from json response

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?

I have given all the needed values …

header Value:

Parameters:
image

How to print out the given josn request and check the request is correct.

What is the authorization header value you are passing here?

If it is OAuth2 token, you can pass it as in the screenshot?

Can you let me know what is the value you are passing through that header and where are you getting it from?

No authtoken is needed,
I am just passing the Authorization in the header.


get_storedAuthValue is the variable I am passin in.

I have given the json req as a single line in Parameters as above screens

I got it atlast, I need to place the josn string in the BODY, instead I placed the same in Parameter.
Another I have replaced " with “” and made as a single line.
I got 200 message.

MySucessMessage as a string holding this message.

:{“ProfileID”:100780,“ResultID”:“CM000”,“ResultDescription”:“Monitor Profile created succeessfully.”,“ResultMessage”:“Success”}

image

Can I change this to dictionary, can you guide me this. SO that It will be easy for me to manipulate and get the values easily.

If not I have to do Split, removing some characters and lot of work…