Hi @Anonymous :
This is impossible in theory, but I have a small trick.
The point is to create an auxiliary collection,I've made a test for your reference:
1\I assume your gallery's data source is-GalleryItems
ClearCollect(
GalleryItems,
{ID:1},{ID:2},{ID:3},{ID:4},{ID:5})
2\Add a Text Input control (TextInput1)
3\Add a Gallery(Gallery3)
If(
IsBlank(TextInput1.Text),
GalleryItems,
Filter(
GalleryItems,
TextInput1.Text in LookUp(
MyCollection, /*MyCollection is my coustom collection I'll show you how to define it later*/
ID = GalleryItems[@ID]
).Text
)
)
4\Add a text input control(TextInput2) into Gallery3
OnChange
RemoveIf(
MyCollection,
ID = ThisItem.ID
);
Collect(
MyCollection,
{
ID: ThisItem.ID,
Text: TextInput2.Text
}
)
Default
LookUp(MyCollection,ID=ThisItem.ID).Text

Although your requirement is to calculate the distance(I can’t test because you didn’t provide details), the principle is the same.
Best Regards,
Bof