i got a problem with a ForAll Loop with a Connector in it;
at the Second For All Loop(as ltp2) i'm making a Nested Collection;
The key values of ThreatID and PostID in this loop are unique combination.
but when i use the the same values within the Office365Groupsmail connector. that i just to get the attachment from this email at AttachmentInfo. it runs every time the first key values of the Collection.
anyone know why the forall doesn't work on the Connector;
Code;
ForAll(GroupThreadsV2 As gtv2,
If(Not(gtv2.id in Bijlage.Threatid),
Collect(ListThreadPostsTemp, Office365GroupsMail.ListThreadPosts(GroupIDVar , gtv2.id ).value);
ForAll(ListThreadPostsTemp As ltpt2,
If(Not(gtv2.id in ListThreadPosts.Threatid),
Collect(ListThreadPosts, Table({
Threatid: gtv2.id,
Postid: ltpt2.id,
body: ltpt2.body,
emailSender: ltpt2.from
}))))));
ForAll(ListThreadPosts As ltp2,
Collect(Bijlage, Table({
Threatid: ltp2.Threatid,
Postid: ltp2.Postid,
body: ltp2.body,
emailSender: ltp2.emailSender,
AttachmentInfo:Office365GroupsMail.GetAttachments(GroupIDVar, ltp2.Threatid, ltp2.Postid).value
})));
Clear(ListThreadPosts);
Clear(ListThreadPostsTemp);
Collection name; listthreadPosts
Collection Bijlage;
NestedCollection Bijlage.AttachmentInfo ;
are all the same;
Solved! Go to Solution.
i solved it myself code is below;
ForAll(GroupThreadsV1 As gtv2,
If(Not(gtv2.id in Bijlage.Threatid),
Collect(ListThreadPostsTemp,Table({
ThreatID: gtv2.id,
PostInfo: Office365GroupsMail.ListThreadPosts(GroupIDVar , gtv2.id ).value}));
ForAll(ListThreadPostsTemp As ltpt2,
If(Not(ltpt2.ThreatID in ListThreadPosts.Threatid),
Collect(ListThreadPosts, Table({
Threatid: ltpt2.ThreatID,
Postid: First(ltpt2.PostInfo).id,
body: First(ltpt2.PostInfo).body,
emailSender: First(ltpt2.PostInfo).from
}))));
Patch(GroupThreadsV2,{id: gtv2.id},{Status: 1});
));
ForAll(ListThreadPosts As ltp2,
If(Not(ltp2.Threatid in Bijlage.Threatid),
Collect(Bijlage, Table({
Threatid: ltp2.Threatid,
Postid: ltp2.Postid,
body: ltp2.body,
emailSender: ltp2.emailSender,
AttachmentInfo: Office365GroupsMail.GetAttachments(GroupIDVar, ltp2.Threatid, ltp2.Postid).value
}));
Patch(GroupThreadsV2,{id: ltp2.Threatid},{Status: 2})
));
Clear(ListThreadPostsTemp);
i solved it myself code is below;
ForAll(GroupThreadsV1 As gtv2,
If(Not(gtv2.id in Bijlage.Threatid),
Collect(ListThreadPostsTemp,Table({
ThreatID: gtv2.id,
PostInfo: Office365GroupsMail.ListThreadPosts(GroupIDVar , gtv2.id ).value}));
ForAll(ListThreadPostsTemp As ltpt2,
If(Not(ltpt2.ThreatID in ListThreadPosts.Threatid),
Collect(ListThreadPosts, Table({
Threatid: ltpt2.ThreatID,
Postid: First(ltpt2.PostInfo).id,
body: First(ltpt2.PostInfo).body,
emailSender: First(ltpt2.PostInfo).from
}))));
Patch(GroupThreadsV2,{id: gtv2.id},{Status: 1});
));
ForAll(ListThreadPosts As ltp2,
If(Not(ltp2.Threatid in Bijlage.Threatid),
Collect(Bijlage, Table({
Threatid: ltp2.Threatid,
Postid: ltp2.Postid,
body: ltp2.body,
emailSender: ltp2.emailSender,
AttachmentInfo: Office365GroupsMail.GetAttachments(GroupIDVar, ltp2.Threatid, ltp2.Postid).value
}));
Patch(GroupThreadsV2,{id: ltp2.Threatid},{Status: 2})
));
Clear(ListThreadPostsTemp);
User | Count |
---|---|
255 | |
114 | |
95 | |
48 | |
38 |