Hello,
I am trying to insert an image in to a picture content control in a Word template using Populate a Microsoft Word Template. I would like to do this via an 'if' expression. If a value in a list equals X insert image 1, or if it equals Y then insert image 2. The images are saved in a SharePoint document library and in the flow via a Get File Content step. The 'if' expression is in the relevant advanced parameters box in the Populate step. As part of debugging I have simplified the 'if' statement so it is not checking a list and will just come out true (1=1)).
This is the expression I am using:
if(equals(1, 1), body('Image_1'), body('Image_2'))
When building the expression the body('Image_1') and body('Image_2') were added using the Dynamic Content selector.
When run, the flow gives an error in this step. It looks like it has retrieved some file content but doesn't recognise it. In the testing run it shows this in the relevant parameter:
"dynamicFileSchema/1080646312": "�PNG\r\n\u001a\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0000\u001e\u0000\u0000\u0000\u001e\b\u0006\u0000\u0000\u0000;0��\u0000\u0000\u0000\u0001sRGB\u0000��\u001c�\u0000\u0000\u0000DIDATHK��1\r\u0000 \fEA��\t\u001a��\u000e��Y�\u0002���Zk�3>L9ܥ��Kz�F\u001d\u0013\u0010W��]�\u001auL@\\1Z,.q�\u0004.�_b�f�d\\\u0000\u0000\u0000\u0000IEND�B`�",
If I remove the if statement and just use body('Image_1') (or 2) added using the dynamic content option it works as intended.
Have I misunderstood something basic about using 'if' expressions in this context? I'm failing to understand why body('Image_1') behaves differently when entered directly and as the output of the 'if' expression. Any help very gratefully appreciated. And please accept my apologies if I'm doing something daft or exposing some basic misunderstandings!
Some images:

