Skip to main content
1-Visitor
February 10, 2017
Question

Passing json value from text box to a service input in mashup

  • February 10, 2017
  • 2 replies
  • 3521 views

Hi Team,

we have a textBox1 in mashup and user enters a json. now we have a service testJson which has a parameter called Input1 with json type.

I am trying bind the text entered in the text box to the Input1. I am not getting any error but the binding is not happening.

If it is because of data type mismatch, please let me know how to get json input from mashup and bind it to json service input parameter.

Since we are using the testJson service in many place, we don't want to change the type of the service.

Can anybody suggest some helpful tips?

Thanks.

2 replies

20-Turquoise
February 10, 2017

Hi,

Textbox would have an output of string format, which is (as you assumed) why you cannot bind it to your service with the input parameter of type json. You may try creating a supplemental service that would convert the string to json and then bind it to your testJson service.

5-Regular Member
February 10, 2017

As Polina suggested, I would change the data type of the service to a string and then you should be able to use the command var json = JSON.parse(inputParam).

20-Turquoise
February 10, 2017

Hi James, I believe their goal is not to change the input type of their main service (testJson), therefore I suggested implementing an intermediate service which would consume the string type from the textbox and feed json to the testJson service.  Hope this makes sense.

5-Regular Member
February 13, 2017

Rdhakrishnan Kandasamy​, hey did this answer help you at all? If so, you may want to try marking it correct to help other community users find the answers to their problems! Thanks!