Hi
@RC-10091206-0,
The main limitation is with the HTML Text control itself: hyperlinks inside the HtmlText property don't trigger the control's OnSelect formula. Microsoft documents this explicitly, so there isn't a supported way to attach Set()/UpdateContext() directly to an <a> element embedded in the HTML.
For this scenario, I would use a data-driven Canvas App pattern instead of relying on the hyperlink inside the HTML.
For example, keep the criteria text and the linked criteria/action as separate data:
CriteriaText
CriteriaId
LinkText
LinkType
Then render the normal criteria text and place a Power Apps Link or Text control over/alongside the link area. Its OnSelect can set the selected record and show a popup:
Set(varSelectedCriteria, ThisItem);
Set(varShowCriteriaPopup, true)
Popup/container:
Visible = varShowCriteriaPopup
Close button:
Set(varShowCriteriaPopup, false)
The popup can then display:
varSelectedCriteria.CriteriaText
or whatever fields belong to that Criteria record.
If the hyperlink must remain embedded at arbitrary positions inside long/dynamic HTML, I would consider changing the rendering model rather than trying to calculate the hyperlink's position. For example, store the criteria as structured content and render the text/link portions as separate controls inside a flexible container.
Deep linking is useful when the requirement is to open a Canvas App or navigate to a particular screen/record, because Power Apps supports query parameters through Param(). It doesn't provide an in-place popup mechanism inside the currently running Canvas App.
So for the requirement:
Click link → stay on same screen → open popup → show selected Criteria data
I would use:
Gallery item
↓
Criteria / Link control
↓
Set(varSelectedCriteria, ThisItem)
Set(varShowCriteriaPopup, true)
↓
Popup Container
↓
Selected Criteria details
If the content truly has arbitrary hyperlinks embedded within dynamic HTML, there isn't a clean supported way to make those individual <a> elements directly execute Power Fx. In that case, restructuring the content into separate clickable Canvas controls is the more maintainable approach.