App Intents: String array parameter value clears immediately in Shortcuts editor

Hello,

I am experiencing an issue with the App Intents framework where a parameter of type [String] (String Array) fails to persist user input in the Shortcuts app action editor.

Issue Description: When adding an item to the String Array parameter in the Shortcuts app action editor, the input text automatically clears/resets to empty within less than 1 second. This happens spontaneously while the keyboard is still active, or immediately after typing, making it impossible to input any values.

Environment:

  • Xcode Version: 26.2 (17C52)

  • iOS Version: 26.2.1

  • Device: iPhone 17

Code Snippet:

import AppIntents
import SwiftUI

struct TestStringArrayIntent: AppIntent {
    
    static var title: LocalizedStringResource = "Test Array Input Bug"
    static var description: IntentDescription = "Reproduces the issue where String Array input clears automatically."

    // PROBLEM:
    // Input for this parameter vanishes automatically < 1s after typing.
    @Parameter(title: "Test Strings", default: [])
    var strings: [String]

    func perform() async throws -> some IntentResult & ReturnsValue<String> {
        return .result(value: "Count: \(strings.count)")
    }
}

Steps to Reproduce:

Build and install the app containing the code above.

Open the Shortcuts app and create a new shortcut.

Add the "Test Array Input Bug" action.

Tap the "Test Strings" parameter to add a new item.

Type any text (e.g., "Hi").

Observe: Wait for about 1 second

Observed Behavior: The text field clears itself automatically. The array remains empty ([]).

Expected Behavior: The text should remain in the field and be successfully added to the array.

**Filed as Feedback:**FB21808619

Thank you.

I experience the same problem. Have you managed to resolve it?

@maxik

Thanks for the post, can you provide more information about the setup of your environment as this issue is not happening currently with the latest release of iOS. It is recommended to ensure that your Xcode project is correctly configured to build against the latest SDKs and that your development environment is up to date.

To work around this issue, you can make the parameter optional and remove the argument. This prevents the Shortcuts editor from continuously applying the empty array state over the user's active input. However I don’t see the issue on the latest release and that’s why is so important to provide the details of the iOS version you are targeting and what Xcode are you using.

Albert
  Worldwide Developer Relations.

Hi, I'm using the latest Xcode (26.4.1) and I'm targeting iOS 16.6. Also, make sure that you don't provide parametrized summary - in this case it works correctly. I'm using something like that:

    static var parameterSummary: some ParameterSummary {
        Summary("List Items") {
            \.$collections
        }
    }

The issue occurs only if you have the "form" view.

It's easily reproducible with this configuration. I tried also with an optional array [String]? and it doesn't help.

I've found a workaround which in my case is suitable. I added predefined values this way:

    @Parameter(title: "Collections", optionsProvider: CollectionsOptionsProvider())
    var collections: [String]?

However, it isn't good enough if someone needs a completely custom input.

This has been around at least since iOS 26.0.

People inside Apple, see FB22249314 for details

Thank you for your prompt response. It is evident that the issue will persist in iOS 16. Have you attempted using the latest iOS version, despite it not being the target platform? Regrettably, even if the issue has been resolved, iOS 16 will still not exhibit the desired behavior, and maybe is a limitation with the App Intents framework on iOS 16

Since you need completely custom, open-ended input and cannot rely on predefined options, the best workaround I can think in iOS 16 is to handle this in the form view is to use a single, multi-line String parameter and parse it into an array yourself?

Albert
  Worldwide Developer Relations.

App Intents: String array parameter value clears immediately in Shortcuts editor
 
 
Q