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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Converting numerical v...
Power Apps
Unanswered

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:
I have the same question (0)
  • Verified answer
    Ethan_009 Profile Picture
    4,838 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard