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

Change Collection column data type

(1) ShareShare
ReportReport
Posted on by

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
    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

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard