Hi All,
I'm trying to devise a satisfactory way to display image thumbnails of attachments in separate image controls on a form (these image controls are not in a gallery and can't be in a gallery).
- Quoting a direct url link from the Sharepoint site is unsatisfactory as it requires users to be logged into Sharepoint specifically otherwise the thumbnail appears blank.
- Using the 'First(LastN' formula is also unsatisfactory as it will display duplicates of the last attachment of an item in all unused image controls (Users have the ability to load up to 10 images, but sometimes will only load 1 for a given form).
So...I'm trying to create a collection of all attachment 'values' and 'display names' in a given item (up to 10) using the ClearCollect function when users open the form from the main gallery screen so that I can use the 'Lookup' function in each respective image control (1 through to 10).
But I can't get the collection to work correctly.
If I use this formula:
ClearCollect(StoryImages, {ImgName: ThisItem.Attachments.DisplayName, ImgData: ThisItem.Attachments.Value});
I get two nested tables (with correct data inside them), which seemingly confuses the Lookup function.
Example Image:

If I use this formula:
ClearCollect(StoryImages, ThisItem.Attachments.DisplayName, ThisItem.Attachments.Value);
I get a table with the display names listed correctly, but the Value data is missing.
Example Image:

If I use this formula:
ClearCollect(StoryImages, ThisItem.Attachments.Value);
I get all the image values in a nice table, but of course no image name to use as a 'key' for the Lookup function.
Example Image:

What I need is this Photoshop representation of the table:
The Holy Grail
If I can achieve this, it's my understanding that I could use the following Lookup formula to reference the specific image value for a specific image control assuming I've named each collection column 'ImgName' and 'ImgData'):
LookUp(StoryImages, ImgName = "Image001.jpg").ImgData
This formula is derived from this article for reference:
http://powerappsguide.com/blog/post/data---how-to-access-nested-collectionstables
I've been battling this particular issue for months now, and as you might be able to tell I've tried just about every solution out there to no avail. If anyone is able to guide me in the right direction with respect to this collection problem I'll be very grateful.
Thanks in advance,
Chris.