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 Apps / Converting numerical v...
Power Apps
Answered

Converting numerical values in a collection to string values

(0) ShareShare
ReportReport
Posted on by 260

Hi all

 

Hope someone can help or point me in the right direction.

 

A collection is created called ServerListCollection based on a number input field called TotalServersInput with the following code...

 

 

 

ClearCollect(ServerListCollection, {});
ForAll(
 Sequence(Value(TotalServersInput.Text)),
 Collect(ServerListCollection, { Value: Text(Value) })
);
ServerListCollection

 

 

 

This works a treat, but I want to convert all the numbers in this list into text strings. I have jumbled together the following code, but I cannot get it working for my poor brain.  I've confirmed that the TotalServersInput text field is formatted as a number and can see the name of the single column in the collection is called Value.

 

ClearCollect(ServerListCollection, {});
ForAll(
 Sequence(Value(TotalServersInput.Text)),
 Collect(ServerListCollection, { Value: Text(Value) })
);
ForAll(
 ServerListCollection,
// Data(ServerListCollection),
 UpdateIf(
 ServerListCollection,
 Value in Value(ServerListCollection),
 {
 Value: Text("server" & Text(Value))
 }
 )
);
ServerListCollection

 

This is the error Power Apps is giving me...

 

"Expected text or number. We expect text or a number at this point in the formula. This error will occur if you use a function that requires either text or a number but you supply, for example, a boolean value."

 

I am wondering how I can fix the code, please help!

Categories:
  • Verified answer
    Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @fnanfne ,

     

    Try this instead of your 2nd ForAll,

    UpdateIf(
     ServerListCollection,
     true,
     {
     Value: Concatenate("server",Text(Value))
     }
    )

     

    Hope this helps

  • fnanfne Profile Picture
    260 on at

    Hi @Ethan_R that works for me, thank you soooooo much!!

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 Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard