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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Getting an Array of In...
Power Automate
Answered

Getting an Array of Integers from an adaptive card input field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've got the following problem:

I am using a teams channel to send an adaptive card (waiting for response), to get a string of ID's (in the format of ID1,ID2,ID3,...). I then need to get that list of ID's into an Integer Array. Right now this is the point i am stuck at. I've tried multiple things but couldn't manage to do it. 

 

The exact setup isn't all too important, however, this is my (simple) adaptive card:

 

{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3",
"body": [
{
"type": "TextBlock",
"text": "Form Paid ID's",
"wrap": true,
"size": "Medium",
"weight": "Bolder",
"horizontalAlignment": "Center"
},
{
"type": "TextBlock",
"text": "Enter all individual ID's in the following format: ",
"wrap": true,
"horizontalAlignment": "Center"
},
{
"type": "TextBlock",
"text": "*ID 1*,*ID 2*, *ID 3*, ...",
"wrap": true,
"horizontalAlignment": "Center",
"weight": "Bolder"
},
{
"type": "Input.Text",
"placeholder": "4353,7457,3944,...",
"id": "inputField"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"id": "submitButton"
}
]
}
]
}

 

I would totally appreciate some help. Thank you in advance!

 

Categories:
  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @Anonymous,

     

    After the Post the adaptive card action you could collect the data outputs of the specific InputField id and convert that string value to an array by using a Select action. In the Map field you can convert each item to a number by using an int function.

     

    Below is an example

    Btw, the if function is used to check if only one id is submitted. In that case you cannot/don't have to use a split.

     

     

    if(equals(indexOf(outputs('Post_adaptive_card_and_wait_for_a_response')?['body/data/InputField'], ','), -1), createArray(outputs('Post_adaptive_card_and_wait_for_a_response')?['body/data/InputField']), split(outputs('Post_adaptive_card_and_wait_for_a_response')?['body/data/InputField'], ','))

     

     

     

    int(item())

     

     

    stringtointarray.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The select requieres a field and a value. What do i use for those two? 

     

    DominicWill_0-1677699231887.png

     

  • Verified answer
    Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @Anonymous,

     

    1. Can you add the expression in the From field via the expression tab?

     

    gettingarray.png

    2. Can you switch the Map field to text mode first (below is a gif to demonstrate this, click on it to see it in higher resolution)

    It currently is using key/value mode with two columns. You only need the values, no keys. So, only one column is needed.

     

    switchtotextmodeselect_array.gif

     

     

    3. Add the expression below via the expression tab to the Map field

     

    int(item())

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you very much, it works now!

  • mad95 Profile Picture
    28 on at

    Hi, can i ask you how you yoused than that array ?cause i've your same issu but with string and i need to use those strings in this array into a Get User Profile V2, and i cannot manage to solve it. thank you

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#2
Henil Profile Picture

Henil 128

#3
anirudhev Profile Picture

anirudhev 124

Last 30 days Overall leaderboard