'How to get full-size image from image field in PowerApps using IOrganizationService?
In PowerApps, let's say I have a field of "image" type called foo_imagefield on a table foo_testtable. I want to access the full size of this image in a plugin or console app using IOrganizationService. I can retrieve the record with the image field as follows:
string[] columns = { "foo_imagefield" };
Entity testRecord = Service.Retrieve("foo_testtable", new Guid("4B365AFD-B31C-EC11-B6E6-000D3A4EA781"), new ColumnSet(columns));
Now I can get the image bytes from the field:
byte[] imageBytes = testRecord.GetAttributeValue<byte[]>("foo_imagefield");
Great, except this only seems to give me the thumbnail version of the image (I believe PowerApps reduces it to 144px * 144px). It's super tiny. I know I can get the full version via a URL (e.g. https://myinstance.crm.dynamics.com/Image/download.aspx?Entity=foo_testtable&Attribute=foo_imagefield&Id=4b365afd-b31c-ec11-b6e6-000d3a4ea781&Timestamp=637801267356898020&Full=true as long as you are authenticated). I can also get the full version via rest API (e.g. GET /api/data/v9.1/<entity-type(id)>/<image-attribute-name>/$value?size=full). But being that I'm doing this in a plugin, I don't want to have to authenticate again.
Is there any way to get the full image with Microsoft.CRM.SDK IOrganizationService?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
