# Trim All Input Fields at Once

**URL:** <https://forum.cloverdx.com/t/trim-all-input-fields-at-once/1702>\
**Category:** CloverDX Platform\
**Created:** [December 11, 2015, 12:00am UTC](https://forum.cloverdx.com/t/trim-all-input-fields-at-once/1702 "2015-12-11T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yichuansancun](https://avatars.discourse-cdn.com/v4/letter/y/8e7dd6/32.png) [@yichuansancun](https://forum.cloverdx.com/u/yichuansancun)\
**Post date:** [December 11, 2015, 12:00am UTC](https://forum.cloverdx.com/t/trim-all-input-fields-at-once/1702/1 "2015-12-11T00:00:00Z")

</div>

I am trying to do this:  
$out.0.\* = trim($in.0.\*);

But it is not working with the following error msg:

Function trim(string) is not applicable for the arguments (record(recordName1))

Anyone knows if this is possible of trim all input at once?

Perri

---

<div class="post-metadata">

**Author:** ![Lukas\_Cholasta](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/lukas_cholasta/32/166_2.png) [@Lukas\_Cholasta](https://forum.cloverdx.com/u/Lukas_Cholasta)\
**Post date:** [December 15, 2015, 12:54pm UTC](https://forum.cloverdx.com/t/trim-all-input-fields-at-once/1702/2 "2015-12-15T12:54:06Z")

</div>

Hi Perri

Of course it is possible, however as the error message implies, you cannot use the trim() function for an argument that is not a string. So you need to get the string value of each field first, trim it and then send it to output. For such cases the CTL2 utilizes so called [dynamic field access](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/field-access-functions-ctl2.html) functions. These are able to get the values from record field without knowing their count or names before the graph starts. Please see the attached graph where these are implemented.

[trim\_all\_fields.grf](https://cdn.cloverdx.com/forum/18108%5F180c46b0f3d1c842a583db374e2e9e24/trim%5Fall%5Ffields.grf)  
Best regards

- [trim\_all\_fields.grf](https://cdn.cloverdx.com/forum/18108%5F180c46b0f3d1c842a583db374e2e9e24/trim%5Fall%5Ffields.grf)
