cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Highlighted
Level 1

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

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.

4 REPLIES 4

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

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.

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

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).

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

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.

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

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!