AppIntent with Input from share sheet or previous step?

I have the following parameter:

    @Parameter(title: "Image", description: "Image to copy", supportedTypeIdentifiers: ["com.image"], inputConnectionBehavior: .connectToPreviousIntentResult)

    var imageFile: IntentFile?

When I drop my AppIntent into a shortcut, though, I am unable to connect this parameter to the output of the previous step.

Given the documentation I have no idea how to achieve this, if the above, is not the correct way to do so.

Accepted Answer

Figured it out.

I needed to tap and hold / right click on the choose-file button in shortcuts to select a variable…

I don’t think users are going to get remotely close to figuring that out

For any one seeing this in the future "Com.image" is not the correct UTType for image. It's "public.image". That did not impact the problem at hand here, though.

    @Parameter(title: "Image", description: "Image to copy", supportedTypeIdentifiers: ["public.image"], inputConnectionBehavior: .connectToPreviousIntentResult)

AppIntent with Input from share sheet or previous step?
 
 
Q