Perfect, cool
Thanks
#nK
Hi now i am trying for sending the first 15 messages. do u have any idea?
Anyway, the Get messages activity is returning you a list of messages !
You can pick the latest 15 right ? May be take function should help.
Thanks
#nK
yes. i am trying
Okay @Yesodha_Karuppusamy
Feel free to post if any challenges !
@Nithinkrishna sure
Hi @Nithinkrishna i am not getting idea…kindly help me to extract the first 15 messages.
Could you please show the Get Messages
output variable in the locals panel while you debug, First step is to check how its giving us data to get the 15 messages !
Thanks
#nK
I am getting all the messages which are present in the channel
You are getting 2 messages or all now ?
Also, could you please show the Locals menu by debugging because it will help us to understand the object type and props to fetch the message ?
Thanks
#nK
It’s been giving you 636 messages which is cool.
The object type I’m seeing here is Message[]
So you should now pass the object in For-Each
as Get_OutMessages.Take(5)
This should print the top 5 messages, Kindly check if that helps.
Thanks
#nK
will try and let u know
In loop is taking only first 5 messages but on copying is copying only one message.
My boss told that u read one by one and group together to copy the messsage
Okay I got your point → You want to combine all the latest 5 messages into one & send to other channel. Is that correct ?
Thanks
#nK
yes ur right
Remove the For-each
Once you get the messages from the GET
activity, just pass the below statement in Message Text
property of send
//Joining the latest 5 messages into one string separated by comma
String.Join(",", Get_OutMessages.Take(5).Select(Function(msgObj) msgObj.Text))
//String.Join(<separator>, collection)
If you need a different separator just update the first argument
Hope this helps.
Thanks
#nK
@Nithinkrishna thanks, i will try and let u know.
Sure @Yesodha_Karuppusamy
So just to iterate, you will be now having one Get Messages
activity and one Send Messages
activity.
Thanks
#nK
yes ur rite