35
Views
2
Comments
Solved
String formatting on Json ouput?

Hello everyone, i have a quick question that i wonder if someone could help me with? 

I have a function that converts binary data to text, and then feeds that into a Json Deseralize. The output string is the following: Then following that, there is a long string of text that i need, as currently the top part of the output is throwing out an error on our frontend:

So my plan is to simply integrate a string format into the logic flow, but ive never done it before and dont really know how to go about doing it? 

Here is my logic flow: 

UserImage.jpg
Morgan Kemp
Solution

Sorry for the slow reply on this, but to answer your question, no that wasn't the full Json body, as i cant share that info publicly. 


But i since found a few built in functions that helped replace some of the index values of the output string the null to then remove the error message. 

something like this: 

Replace(value,Substr(value.Text,0,Index(TextValue,"Request=")+9),"")

You can replace the 9 with any number of indexes that you need to be null, but in my case the number of characters in my header that was throwing an error was 9. 

UserImage.jpg
Vitheya sudesan

Dear Morgan,

The first image you have attached is the output from the Binarydata to text action?


if yes, it will throw an error in json deserialize. Because the output text is not the valid json format.

 if you want to deserialize, then the output should be as follows,

{

  "JwsSignature" :"true",

"request": " text" 

}


Thank you.

UserImage.jpg
Morgan Kemp
Solution

Sorry for the slow reply on this, but to answer your question, no that wasn't the full Json body, as i cant share that info publicly. 


But i since found a few built in functions that helped replace some of the index values of the output string the null to then remove the error message. 

something like this: 

Replace(value,Substr(value.Text,0,Index(TextValue,"Request=")+9),"")

You can replace the 9 with any number of indexes that you need to be null, but in my case the number of characters in my header that was throwing an error was 9. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.