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 / Change Collection colu...
Power Apps
Answered

Change Collection column data type

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I'm fetching data from my database using the Filter function.

There's a column "customer" that is a Boolean type in the database, but in the application I want to change it to String. Is this possible? I've tried searching but came up with nothing.

Categories:
I have the same question (0)
  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    You can add a column to the filtered results that show the string version of the customer boolean column.

     

    Example:

    AddColumns(Filter(...), "CustomerStringValue", Text(customer))

     

    This creates a new column called "CustomerStringValue" that will have the text value of the customer boolean column.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you!

  • vinaygkp Profile Picture
    8 on at

    Hi @Jeff_Thorpe,

     

    What if I don't want to add another column, just want to change the data from boolean to string and add it within the same column.

     

    How that would be done ?

    Please help...

  • CU10091302-0 Profile Picture
    24 on at

    Hey @vinaygkp, I came here with the exact same question. After some head scratching, I discovered you can loop through data with `ForAll()` and convert the columns in the loop.

     

    This works:

     

    /*
    * Create some data that mimics a DB table
    */
    UpdateContext(
     {
     locUserDataFromDB: [
     {
     UserName: "Daniel",
     IsHungry: true,
     NumTacosEaten: 12
     },
     {
     UserName: "Django",
     IsHungry: false,
     NumTacosEaten: 4
     },
     ]
     }
    );
    
    /*
    * Use `ForAll()` to loop through the data and return new records with converted data types.
    */
    UpdateContext(
     {
     locUserDataLocal: ForAll(
     locUserDataFromDB,
     {
     UserName: UserName,
     IsHungry: Text(IsHungry),
     NumTacosEaten: Text(NumTacosEaten)
     }
     )
     }
    );

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard