Logic App gives error when updating CRM field - azure-cosmosdb

I am trying to push some data into CRM utilizing the logic app and the parameter fields.
Some of the fields get pushed through, while others do not. I am trying to understand what is the logic behind this?
All of the fields go through except the LeadPM field. I get this error:
"message": "Syntax error: character '"' is not valid at position 1 in '("Yu li")'."
This is what I have done so far:
When I got this error, I added "" and this did not work, so then I added '' and this did not work either. I finally did not add any quotes and am still getting this error. Any insight on this would be greatly appreciated.
JSON PARSE

It seems the value of your FeaturePM is " and it can't be stored in Lead PM directly. You need to add a \ to escape it. Change the value of FeaturePM to \" and then put it into Lead PM.

Related

Error in the JQL Query: XXX is a reserved JQL word

I'm trying to use Jira's REST API in order to get an issue key using its name (summary).
I do so using env variables and parameters that are received by the function (TestCaseID is the summary in this case).
My get requests receive following information:
var getUrl = {
url : "https://" +
process.env.JIRA_USERNAME +
":" +
process.env.JIRA_PASSWORD +
"#" +
process.env.JIRA_BASE_URL +
"/rest/api/2/search?jql=" +
`Summary~"\"${TestCaseID}\""` ,
method: "GET" };
But I get the following error:
Error in the JQL Query: 'Access' is a reserved JQL word. You must surround it in quotation marks to use it in a query.
this is because the TestCaseID contains this specific word (and unfortunately I can't change it).
I don't understand why it asks me to surround it in quotes since this is exactly what I did when adding the "\" and \"".
I tried multiple different approaches to fix it, but eventually, I receive the same error again and again.
Does anybody have an idea how I can solve it?
I managed to solve it in case someone will face same issue in the future:
I used postman in order to use the feature that provides the request for Nodejs as explained here: Convert postman api call to Node.js call
and saw that 2 backslashes are used instead of one. so adding a second one solved it for me :
`summary~"\\"${TestCaseID}\\""`

Running Go from the command line nested JSON

I can think of workarounds on how to get this working however I'm interested in finding out if there's a solution to this specific problem.
I've got a go program which requires a json string arguement:
go run main.go "{ \"field\" : \"value\" }"
No problems so far. However, am I able to run from the command line if one of the json values is another json string?
go run main.go "{ \"json-string\" : \"{\"nestedfield\" : \"nestedvalue\"}\" }"
It would seem that adding escape characters incorrectly matches up the opening and closing quotes. Am I minuderstanding how this is done or is it (and this is the side I'm coming down on) simply not possible?
To reiterate, this is a question that has piqued my curiosity - I'm aware of alternative approaches - I'm hoping for input related to this specific problem.
Why don't you just put your json config to the file and provide config file name to your application using flag package
Based on the feedback from wiredeye I went down the argument route instead. I've modified the program to run on:
go run main.go field:value field2:value json-string:"{\"nestedfield\":nestedvalue}"
I can then iterate over the os.Args and get the nested json within my program. I'm not using flags directly as I don't know the amount of inputs into the program which would have required me to use duplicate flags (not supported) or parse the flag to a collection (doesn't seem to be supported).
Thanks wiredeye

Fql access error in C# .net?

I am trying to access the following info using FQL in c# .However am getting an HTTP bad request error
string Frnds = api.Get("/fql?q=SELECT+uid+name+username+locale+affiliations+timezone+birthday+sex+proxied_email+current_location+FROM+user+WHERE+uid=me()");
Is there some problem with my query , It seems to look fine to me ?
Have you tried separating each field name with a comma (,) then urlencoding it
you can test out your query here - please note in the following link I added in ","
https://developers.facebook.com/tools/explorer?method=GET&path=fql%3Fq%3DSELECT%20uid%2C%20name%2C%20username%2C%20locale%2C%20affiliations%2C%20timezone%2C%20birthday%2C%20sex%2C%20proxied_email%20%2Ccurrent_location%20FROM%20user%20WHERE%20uid%3Dme%28%29
your query can't parse the fields correctly
https://developers.facebook.com/tools/explorer?method=GET&path=fql%3Fq%3DSELECT%20uid%20name%20username%20locale%20affiliations%20timezone%20birthday%20sex%20proxied_email%20current_location%20FROM%20user%20WHERE%20uid%3Dme%28%29

SqlDataSource erroring when retrieving NVARCHAR(max) column

I'm writing a small ASP .Net application in order to retrieve data from a SQL database. The application uses drop downs in order to select what the next drop down should contain and when a page is selected, it should retrieve the HTML from the database. Everything is working until it gets to the retrival of the HTML data. When I try to retrieve the data, I get:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException:
An unknown error occurred while
processing the request on the server.
The status code returned from the
server was: 500
The HTML column is a defined as NVARCHAR(MAX), but I can't see this causing a problem. The application works if I set the DataValueField to another column. Has one else come across a problem like this? Maybe someone could shine some light on this?
One thing I noted when dealing with varchar(max) columns is that the framework still commonly expects to have a size associated with it. What I ended up having to do was specify the length as -1 to get it to accept a varchar(max) field. Your error message doesn't indicate that this is the problem, but you might try experimenting with it rather than turning off the validation, which could possibly have other repercussions.
Figured it out. Just needed to set ValidateRequest to false at the Page level.

Preventing quotes causing a HttpRequestValidationException

To prevent a HttpRequestValidationException I httpEncode (using a javascript library) my input to send it to the server, where it is httpencoded again and stored. Then process it reversed to get it back, with an extra encode added if it's going into a label.
This seems to work fine but I get a HttpRequestValidationException if I put a single quote into my textbox. The httpEncode changes this to a ' which seems to be what it triggering the validation error. Is there a workaround? I can't afford to turn off page validation at the page level. Also, is this error likely to occur for other characters I haven't yet discovered?
Seems odd that it would choose that as potentially dangerous, when <html> produces no validation problem. Also " encodes to " without a problem.
I've encountered the same problem. Amazing how difficult it is to fix this one.
I've ended up using javascript to replace my apostrophes with a token that I re-replace on the server. I'm posting my code snips below, but these are pretty specific to my situation.
Javascript (Client):
convertedString = originalString.replace(/\'/g, '&apos2;');
ASP.NET (Server):
originalString = HttpUtility.HtmlDecode(
HttpUtility.HtmlDecode(convertedString)
).Replace("&apos2;", "'");

Resources