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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

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

rkandasamy
1-Newbie

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
posipova
20-Turquoise
(To:rkandasamy)

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.

jamesm1
5-Regular Member
(To:rkandasamy)

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

posipova
20-Turquoise
(To:jamesm1)

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.

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!

Top Tags