Error: Cannot find function trim in object in flow designer

skumar_srbh
Tera Guru

I have created an action to fetch the current incident's assignment group member. Later I am using this in a flow with "For Each item in" > "Add member to chat"...(SN - MS Teams integration)

skumar_srbh_0-1690369164913.png

While executing the flow, able to fetch the email IDs via first action. However when it comes to "For Each item in", it says "Error: Cannot find function trim in object (comma separated list of email Ids)".  Any suggestions why this error is appearing.

 

Thanks in advance for help,

Kumar

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@skumar_srbh

so what does that For Each iterate?

Does it iterate user email or user name?

Are you using trim in that custom action?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

it iterate for email ID, which i have fetched via earlier action.

No I am not using trim in custom action. but i can see trim is being used in OOB Action "Add member to chat", which i am using in "for each item in" -
outputs.chat_id = inputs.chatId.trim();
outputs.azure_id = inputs.azureId.trim();

 

I did try to remove trim or add toString() before trim, but it gives same error.

 

Thanks,

Kumar

@skumar_srbh 

try to use toString() and then use trim

outputs.chat_id = inputs.chatId.toString().trim();
outputs.azure_id = inputs.azureId..toString().trim();

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

i did try earlier like this... same issue.