Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

366
Views
How to pass custom data into teams task module from bot adaptive card

I have a teams bot (nodejs) that renders an adaptive card with some table data. We want to provide a richer data viewing experience by iframing a javascript widget inside of a task module that will display the data using interactive D3 charts.

Basically the adaptive card will have a "see more" button, which will invoke a task module containing the html contents.

The part I can't figure out is how to access the data from the html inside the task module. I realize that there is a global object called microsoftTeams that contains metadata and context, but it doesn't seem specific to the adaptive card that was clicked (the adaptive card that invoked the task module). It has much more global info used for teams such as the user and conversation metadata.

I was able to insert the data into the taskInfo object when invoking the task module as a custom param. So my question is, is there a way to access the taskInfo object from inside the HTML iframe?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I am using query strings to get data from the server to the client (There might be a better way, hopefully @Saonti-MSFT comes back with an easier/cleaner way).

This is my task object:

task: {
  type: "continue",
  value: {
    url: `${process.env.HostName}?message=${JSON.stringify(Buffer.from(message).toString("base64"))}`,
    width: 500, 
    height: 736
  },
}

On the client side I then get the search query and convert it back do the following

const urlParams = new URLSearchParams(window.location.search);
const message = urlParams.get('message');

// Needed to remove the quotes and convert spaces to "+" as this was getting lost
const data = atob(message.replace(/"/g,"").replace(/\s/g, "+"));

NOTE: I was only doing this for a single string, but I don't see why would couldn't use an object if you converted it to a string on the server then parsed it on the client.

Hope this helps

over 4 years ago · Santiago Trujillo Report

0

You can check out this Sample. Here you have HTML pages which can be customized. You can create your own webpages and integrate in the task module.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!