0

I am trying to build Image Adaptive Card for the first time, I thought "Description" Property can be added how it can added in the normal web part SPFx. I was wondering how to add "Description" to "ICardParameters"

CardView.ts

  public get data(): IImageCardParameters {
    return {
      primaryText: strings.PrimaryText,
      imageUrl: require('../assets/MicrosoftLogo.png'),
      title: this.properties.title,
      description: this.properties.description --- Type '{ primaryText: string; imageUrl: string; title: string; description: string; }' is not assignable to type 'ICardParameters'. Object literal may only specify known properties, and 'description' does not exist in type 'ICardParameters'.
    };
  }

PropertyPane.ts

PropertyPaneTextField('description',{
                  label: strings.Description,
                  multiline: true,
                  rows: 5
                })
2
  • I am currently doing some research on this issue, will let you know as soon as possible.
    – Zella_msft
    Jul 20, 2022 at 1:52
  • Sure, Thank you. even i tried out some of approach but did not work though.
    – striker92
    Jul 20, 2022 at 11:58

2 Answers 2

1

As per the Microsoft official documentation of IImageCardParameters interface it has two properties:

  • imageUrl
  • primaryText

Also, this interface extends the IBaseCardParameters interface which has below proerties:

  • iconAltText
  • iconProperty
  • title

So, you can only specify above known properties and cannot use 'description' as it does not exist in the interface type you are using.

1
  • Any alternative ?
    – striker92
    Jul 20, 2022 at 15:01
1

According to my research and testing, we cannot add "Description" . IImageCardParameters interface only has imageUrl and primaryText properties. Thanks for your understanding.

More information for reference: IImageCardParameters interface

===================================

If the answer is helpful, please click "√" on the left panel of the answer and kindly upvote it.

1
  • Do you have any further questions about this thread? If you have any questions or progress, you can contact me in time.
    – Zella_msft
    Aug 1, 2022 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.