How to use secure string parameter in Add dymamic content - azure

I have one parameter created which is of type "SecureString" . I want to use that directly in any AddDynamiccontent box .
But it throws me the error like its ecpecting the type string but the passed is "SecureString"
How to pass /convert it?

Now to convert to string :
Output :
So to get Specific value:
Output:

Related

How to remove milliseconds from utcnow() result in Azure data factory

I want to pass a value for parameter usertime, the value should be like 2020-07-23T13:19:31Z , which will be used in my source connection url.
For this i supplied utcnow() function in the value tab. But i realized utcnow() will return the value as "2018-04-15T13:00:00.0000000Z"
To remove the millisecond part i have used the expression substring(utcnow(),1,20).
and also used expression formatDateTime('utcnow()', 'yyyy-MM-ddTHH:mm:ss').
Both my trails are useless where my expression returning error ass invalid parameter.
Could you please help me how can i supply the value 2020-07-23T13:19:31Z in Azure data factory datasource parameters.
You don't want utcNow inside quotes, here is an example from one of my pipelines using your format:
#formatDateTime(utcnow(), 'yyyy-MM-ddTHH:mm:ss')
which gives this result, setting a variable named x:
{
"name": "x",
"value": "2020-07-24T13:44:42Z"
}
Build it in 'Add dynamic content' as you can pick the functions and it will format properly if you aren't familiar.
Your substring won't work because it requires a string for the first parameter and utcnow is a timestamp.

Dynamic inference of type from String value in java

I have a parameter of type object in my endpoint method. I want jackson to be able to convert it to int if it sees "25" i.e. get 25, or boolean if it sees "true" i.e. get true. Currently, I am getting the value as "25" string or "true" as string. I don't have any information about the type of the property before hand.
You can use JSONPARSER and put a check like this:
if (jsonParser.getCurrentToken() == JsonToken.VALUE_NUMBER_INT), then jsonParser.getIntValue()

error with string variable

I'm trying to use a string variable as input to an xml function. When I use this command:
name2_node(i).setTextContent('truck');
there is no error. But when I replace it with:
name2_node(i).setTextContent(type(i,1));
an error occurs like this:
No method 'setTextContent' with matching signature found for class
'org.apache.xerces.dom.ElementImpl'.
The variable type is a string array. In fact when I type type(i,1) in command window the result is:
ans =
string
"truck"
What part am I doing wrong?
Two things:
use a different variable name, type is a built in function which tells you the variable type, hence why it shows "string" in the output.
Then access the cell array of strings with curly braces
vehicletypes = {'car'; 'truck'; 'van'};
name2_node(i).setTextContent(vehicletypes{i,1}); % For i=2, this passes 'truck'

How to replace the Hexadecimal values to its original character string in C?

I have correlated the Token value taken from the following response snippet:
result.sessionToken = '7AFF3BA8\x2DD913\x2D4211\x2D990E\x2D7DF3AB5687B7';
Using the web_reg_save_param function as:
web_reg_save_param(
"TOKEN",
"LB=result.sessionToken = '",
"RB=';",
"ORD=1",LAST);
But in a later request I need to send the correlated value in the below format:
7AFF3BA8-DD913-4211-990E-7DF3AB5687B7
The value \x2D is to be substituted by -.
I am right now using the below 'C' and LR code for this:
strcat(pstr1,lr_eval_string("{RToken}"));
strcat(aSeparator,"\\");
for(a=0,b=0;pstr1[a]!=NULL;a++,b++)
{
if(pstr1[a]==aSeparator[0])
{
strcat(pstr2,"-");
pstr2[b+1]=pstr1[a+4];
a=a+5;
b=b+2;
}
pstr2[b]=pstr1[a];
}
lr_save_string(lr_eval_string(pstr2), "sessionToken");
I wanted a generic and another approach for this problem. I don't want to use web_convert_param function, but if there is a hidden trick to convert the string as desired I would like to know.
Thanks,
Ritika
Try This...lr_save_string(lr_eval_string("{TOKEN}"),"convertedtkn");

Convert String type value to a object type VBS

I need to pass an object type value to a procedures, which read from a text file (String fromat).
'param node- Object type
'param txtvalue - String
Function setTexttoElement(nodename, txtvalue)
nodename.Text = txtvalue
End Function
Method is finely works when passing following values
setTexttoElement myElement, abc
But when reading a file it's take String format. So I need to convert first value as Object
"myElement", "abc"
How to solve this?
You will need to create a reference dictionary to convert the text string to an object effectively, as there is no way for vbscript to know what type of object you are passing to the function. For more information: click here.

Resources