appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Error in data type handling

Open Vidushi-Gupta opened this issue 3 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

When I add a text 123-test in the input widget and reference it in an API body, it gets evaluated as "123-test" and not 123-test. image image

Steps To Reproduce

  1. Create a new app and add an input widget on the canvas
  2. Type 123-test in the input widget
  3. Reference it in the API body

Public Sample App

No response

Issue video log

No response

Version

Cloud - 1.8.11

Vidushi-Gupta avatar Dec 05 '22 10:12 Vidushi-Gupta

@sbalaji1192 @nidhi-nair would the data type project have solved this?

Nikhil-Nandagopal avatar Dec 08 '22 08:12 Nikhil-Nandagopal

This is a smart substitution problem. We're looking at the value, gathering that it is a string without immediate quotes around it and adding the quotes ourselves. Data type handling allowed us to correctly recognize the value as a string and that's all. Do we want to solve for this within smart substitution? If yes, then I'd say this is a feature request to understand context around the binding.

nidhi-nair avatar Dec 08 '22 09:12 nidhi-nair

@nidhi-nair Are we sure this wasn't working before? I distinctly remember that if a user did not add the quotes, we would manually add it; if they did, we would not add it.

Nikhil-Nandagopal avatar Dec 08 '22 09:12 Nikhil-Nandagopal

Yes, I think the way this works has always been with immediate surroundings. That's the reason the value of the second property bitlink_id evaluates correctly. We've always suggested to users that they absorb the other part of the string into the JS binding as well, as {{ "bit.ly/" + Input1.text }}

nidhi-nair avatar Dec 08 '22 11:12 nidhi-nair

This issue is similar to the one reported here.

sribalajig avatar Dec 09 '22 06:12 sribalajig

Closing this instead of one reported here.

riteshkew avatar Apr 12 '24 06:04 riteshkew