Hi there,
Currently I'm building an app where people can add kilometers they've ran to into our app. Based on everyone their kilometers saved in a SharePoint list we want to sum them all together and output it in a text label into the app.
Sum(colEMails,distance) & " / 981"
Due to delegation issues, we are saving the results in a collection and display them in a gallery (items property) by the following code:
With(
{
wEmails: With(
{
wList: Sort(
AddColumns(
GroupBy(
socialDistance,
"Email",
"ItemsByName"
),
"distance",
Sum(
ItemsByName,
Afstand
),
"Emails",
CountRows(ItemsByName)
),
distance,
Descending
)
},
ForAll(
Sequence(CountRows(wList)),
Patch(
Last(
FirstN(
wList,
Value
)
),
{Ranking: Value}
)
)
)
},
Sort(
wEmails,
distance,
Descending
)
)
Which results in:
And save the data to SharePoint with a button (OnSelect property):
Patch(socialDistance,
{
Email: __AuditorEmail,
Datum: txt_datum_2.SelectedDate,
Afstand: Value(Txt_KM_2.Text)
}
);
Gallery output:
Everything is working fine, except that the labels and gallery doesn't refresh when adding new records. It does refresh when you switch to another screen and back. Somewhere reasonable since it re runs the gallery (which contains the filtering of the colEMails collection).
I'm looking for a solution so it automatically refreshes the gallery and updates the colEMails collections.
If you need more information, feel free to comment below!

Report
All responses (
Answers (