Hi!
We’re trying to create a widget, but it won’t render.
Unfortunately, the example from the documentation doesn’t work either.
Only the placeholders are visible in the task.
The response object looks like this:
{
"metaData": {
"error": "",
"num_comments": 0,
"subicon_url": "",
"subtitle": "Added",
"title": "Customer ID",
"fields": [{
"icon_url": "",
"text": "12345",
"type": "text_with_icon",
"name": "Customer number"
}, {
"icon_url": "",
"text": "address",
"type": "text_with_icon",
"name Address"
}, {
"icon_url": "",
"text": "0123456789",
"type": "text_with_icon",
"name": "phone"
}
],
"footers": {
"footer_type": "created",
"created_at": "2022-07-12T06:23:37.4339880Z"
}
},
"template": "summary_with_details_v0"
}
Does anyone have an idea why this fails?
Greetings Andreas
Hi,
I happen to work on this yesterday and successfully got a widget displayed
Did you understand that a widget would only be displayed if there is an attachment on the task, with a URL matching the pattern you gave in the app configuration?
Also try to use the exact example from the demo app in terms of fields just to be sure the error is not coming from a missing icon_url
for example.
Let me know if this helps!
Note: what I understood after a while was that you don’t need an actual file to be attached you can attach a resource based on a single URL
Hello @Bastien_Siebman!
The problem is solved. It was the formatting of the date.
Thanks for the help!
2 Likes
@Andy06,
Can you post the correct date format you used as a benefit to future readers of this thread? Thanks.
1 Like
Sorry for the late reply.
A valid format is the following example.
2022-07-04T09:55:53.000Z
Apparently, C# converts the ISO-8601 format a little differently.
Converted manually it works without problems.
And another tip: CaseSensitivity must be observed here
Hey,
When you say with the URL matching the pattern you gave in the app configuration, are you saying https://exampleapp.com/widget/metadata, or does it need to be task specific as well.
I am currently getting
and when I click on the widget it sends me to
but this is the metadata I want the widget to be showing? Any thoughts?
Try pasting your response in the UI Builder and see if that shows a valid widget.
1 Like
Thanks Bastien - CORS was creating the issue in my application so it wasn’t the widget after all
1 Like