Hello,
I have the following requirement. I have a powerapp page that submits selected social media platforms where a user has agreed to share a message on, as shown below.
So far i have successfully managed to capture and track all messages shared on the different platforms by the different users on my first SharePoint List (SocialMedia SharedBy)
My problem lies in capturing the number of times a message has been shared on a particular social media platform. This needs to be done in the second sharepoint list (Platform Message Counter) which is dedicated on storing the counter for each message on each social media platform shared.



This is what i have so far on my onSelect property of my Submit Button in powerapps.
ForAll(
ComboBox2.SelectedItems,
Patch(
'SocialMedia SharedBy',
Defaults('SocialMedia SharedBy'),
{
MsgID: BrowseGallery1.Selected.ID,
SharedBy: User().FullName,
'Other Shared': Value
}
);
If(
IsBlank(
LookUp(
'Platform Message Counter',
MessageID = BrowseGallery1.Selected.ID
)
),
Patch(
'Platform Message Counter',
Defaults('Platform Message Counter'),
{
MessageID: BrowseGallery1.Selected.ID,
'Platform Shared': Value,
Counter: 1
}
)
)
);
Unfortunately when i try to include the patch for updates incase a message and platform already exists and i only need to update the counter column, i get the error that "this function cannot be invoked within forall". Please help.