Background: this is in support of a searchable database for a non-profit's catalog of rare books, so getting searchable keywords over 1000's of books would be a big job manually. I also want to prove that PowerApps is up to the challenge for the data entry side this application.
Narrative: Using AI Keyword extraction to pull keywords from a title and a description of each item. The sample set has 100 items. The full catalog will have several thousand.
I can't find a viable way to implement this requirement because UpdateContext() and Set() are not allowed inside a ForAll loop. I need to process each item in a gallery, and setting a variable in each step is critical to that. Catch 22.
The Partial Code:
Set(
ExtractedPhrases,
'Key phrase extraction'.Predict(
strPublicationTitle.Text,
{Language: "en"}
).Phrases
);
IfError(
ExtractedPhrases,
Notify(
FirstError.Message,
NotificationType.Error
)
);
IsError(
ForAll(
glryKeyWordExtraction.AllItems,
If(
ThisRecord.Phrase <> "Missing" && ThisRecord.Phrase <> "the",
Patch(
tblPublicationKeyWord,
Defaults(tblPublicationKeyWord),
{
PublicationID: Value(intPublicationID.Text),
KeyWord: ThisRecord.Phrase
}
)
)
)
);
So far, the workarounds I've seen don't support this specific scenario. I can process one item at a time, using OnSelect for that selected item in the gallery, but that means clicking a button potentially 1000's of times....
Is there any way to accomplish this? I've seen suggestions that involve a single column collection for example but I can't seem to get my head around how to incorporate it here.
Ideally, there would be a way to wrap the code above in ForAll(glryKeyWords). If that's not supported, maybe a Flow?
Thanks in advance.