# Want to set format to Text Field componant

**URL:** <https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230>\
**Category:** Ignition\
**Created:** [July 30, 2020, 5:46pm UTC](https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230 "2020-07-30T17:46:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [July 30, 2020, 5:46pm UTC](https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230/1 "2020-07-30T17:46:29Z")

</div>

Hi, I need help, I want to set string format to Text Field componant in perspective  
The string have to be this way:  
Example:  
“Parameter1”:“ParameterValue1”,“Parameter2”:“ParameterValue2”…

There will be multiple key value pairs.  
Can anyone help me for this?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 30, 2020, 6:45pm UTC](https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230/2 "2020-07-30T18:45:03Z")

</div>

Are these key-value pairs in a dataset? If so, you might be able to do something with `groupConcat` and `concat` in the expression language.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [July 30, 2020, 6:51pm UTC](https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230/3 "2020-07-30T18:51:35Z")

</div>

I want to create json string using this parameters.  
From backend scripting I am adding {} brackets to these parameters.  
user should enter parameters like that way so I can create json string.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 30, 2020, 6:55pm UTC](https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230/4 "2020-07-30T18:55:43Z")

</div>

I see, so all these values are being entered by the user then? I don’t think you can dynamically add key-value pairs to a Object type custom property so someone correct me if I am wrong. I also don’t know how else you would keep a consistent json object.

Personally, I would probably probably insert each parameter-value into a dataset formed like the following

```auto
paramter value paramtervalue
========================================
paramter1 value1 paramter1:value
...

```

Then to display ALL paramter/value pairs, you would just need to do `groupConcat(dataset, paramterValue, ",")` to display them all in a text field.

You would have to then convert the dataset to json for whatever you need later on. But having a dataset -\> json conversion function is probably a good idea in general.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [July 30, 2020, 7:02pm UTC](https://forum.inductiveautomation.com/t/want-to-set-format-to-text-field-componant/37230/5 "2020-07-30T19:02:27Z")

</div>

Okay, will try this way.  
Thanks for your reply.
