web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - Bot Administration
Unanswered

Create JSON array out of user responses in Copilot Studio

(0) ShareShare
ReportReport
Posted on by
Hi All,
 
I am trying to create JSON array out of the user responses. How can we do that in Copilot studio? 
 
Any help will be much appreciated!
 
Thank you.
Categories:
I have the same question (0)
  • SaiRT14 Profile Picture
    1,988 Super User 2025 Season 2 on at
    Create JSON array out of user responses in Copilot Studio
     
    Create a prompt action in Copilot Studio to gather input from the user.
    Use a structured approach to capture multiple responses, such as using placeholders or asking sequential questions.
    Use the input from the user and structure it into JSON format.
     
    Define a backend or inline function to parse and store the responses dynamically.
    function createJsonArray(responses) {
        const jsonArray = responses.map(response => ({
            key: response.key,
            value: response.value
        }));
        return JSON.stringify(jsonArray);
    }
     
    Use an Action in Copilot Studio to concatenate or structure the responses into a JSON array dynamically.
    [
        {
            "name": "John Doe",
            "email": "johndoe@example.com",
            "phone": "123-456-7890"
        },
        {
            "name": "Jane Smith",
            "email": "janesmith@example.com",
            "phone": "987-654-3210"
        }
    ]
     
    save it to a database, or send it to an API endpoint.
     
    pls try and let me know if you need more details. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 424 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 318 Super User 2025 Season 2

#3
CU15090955-0 Profile Picture

CU15090955-0 46

Last 30 days Overall leaderboard

Featured topics