Saving a Text starting with a hashtag

I have an attribute of an entity that is of text data type. When I import an excel with records that have the value beginning with "#", for example "#-027268-DEV", the beginning "#" is removed when saving into DB and the result becomes "-027268-DEV" when I use View Data function to check. What is the problem behind? how can i save the "#" into db as well?

Hello Stephen Li,

Are you importing the data straight to the database (1) or are you using an action (2)?

1:

2:


Miguel Rocha wrote:

Hello Stephen Li,

Are you importing the data straight to the database (1) or are you using an action (2)?

1:

2:


 

there is a UI button that execute a screen action with "excel to record list" and Create records in entity

Hello Stephen,

 

Could you please post screenshot of your action used to import data?


Regards,

Sanjay

Solution

Hi Stephen,

You are right, I also observed the same i.e. while inserting a string value in the DB table, which prefix with # character the # character is getting avoided. i.e 

Actual Value ---> "#-027268-DEV" 

DB table stored value ----> "-027268-DEV" 


Observations (Used SQL Query Node and Entity Action)

- Tried to escape the # character by placing the (forward slash) escape character still it didn't worked

DB table stored value ----> "\#-027268-DEV"

- Tried with double ## still it didn't worked

DB table stored value ----> "-027268-DEV"

- Did some Google for the same observation and found only one related link which also didn't helped

https://stackoverflow.com/questions/52647195/the-text-starts-with-symbol-is-not-inserted-into-the-datatable 


Solution

1) While inserting the value, append a character combination as prefix character like \# and when retrieving the value in the UI interface replace the character combination with # symbol

2) Add a space character in-front/prefix of # character and insert the value in DB table and when using the same value in actual, Trim the value to remove the extract space

DB table stored value ----> " #-027268-DEV"


Hope this helps you!


Regards,

Benjith Sam

Solution

Benjith Sam wrote:

Hi Stephen,

You are right, I also observed the same i.e. while inserting a string value in the DB table, which prefix with # character the # character is getting avoided. i.e 

Actual Value ---> "#-027268-DEV" 

DB table stored value ----> "-027268-DEV" 


Observations (Used SQL Query Node and Entity Action)

- Tried to escape the # character by placing the (forward slash) escape character still it didn't worked

DB table stored value ----> "\#-027268-DEV"

- Tried with double ## still it didn't worked

DB table stored value ----> "-027268-DEV"

- Did some Google for the same observation and found only one related link which also didn't helped

https://stackoverflow.com/questions/52647195/the-text-starts-with-symbol-is-not-inserted-into-the-datatable 


Solution

1) While inserting the value, append a character combination as prefix character like \# and when retrieving the value in the UI interface replace the character combination with # symbol

2) Add a space character in-front/prefix of # character and insert the value in DB table and when using the same value in actual, Trim the value to remove the extract space

DB table stored value ----> " #-027268-DEV"


Hope this helps you!


Regards,

Benjith Sam

 Thank you. I think your solutions are some good workarounds. Without an official tool to counter this problem I would say yours would be the solution for this question at the moment. Thanks again! 

Stephen Li wrote:

Thank you. I think your solutions are some good workarounds. Without an official tool to counter this problem I would say yours would be the solution for this question at the moment. Thanks again! 

You are welcome, Stephen :)

Glad I could be of help!


Regards,

Benjith Sam