Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to get the comment that starts with a particular string

Bindhu1
Tera Contributor

Hi all,

I have a requirement where I have to get the specific comment from RITM to  catalog task that is created after approval.

I am handling it from the flow but it is not working as expected. I have to only get the comment that starts a particular string 'comment from approval note', but here I am getting the entire list of comments. Can anyone tell me how to get that comment that starts with a particular string, thanks in advance.

Bindhu1_0-1667921934936.png

 

7 REPLIES 7

Theo BOULANGER
Giga Guru

Hello @Bindhu1 

 

You can try this instead :

var com = fd_data.trigger.current.requested_item.comments.getJournalEntry(-1);
if (com.indexOf("comment from Approval note") > -1 ) {
    return com;
}
 
Or you can simply add a if condition in the flow :
if comments "contains" -> "comment from Approval note"
 
Regards,

Hi ,

Both are returning all the comments, requirement is to just get the comment which contains the string "comment from Approval note".

Thanks for replying

Can you post a screenshot about your flow's execution on this particular action please

Bindhu1_0-1667987306376.png

 

Bindhu1_1-1667987390494.png