Skip to main content

Notifications

Community site session details

Community site session details

Session Id : qqYx9bSFUmNwTZaqyoRlXW
Power Apps - Building Power Apps
Answered

Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

Like (3) ShareShare
ReportReport
Posted on 5 Dec 2018 00:43:11 by 704

I am new to PowerApps and still learning. It seems sometimes the editor likes to column names with spaces to be entered as 'Student Last Name' and other times Student_x0020_Last_x0020_Name. Sometimes it autofills one and sometimes the other? Can anyone explain why?

 

Also as an add-on question why does autofill with commands properly space over but autofill with column names does an overwrite of following text? Drives me nuts when the autofill erases a bunch on line since I never know when it is going to do it.

  • Sawh Profile Picture
    109 on 20 Oct 2023 at 20:07:13
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    I have a model-driven app in power apps and am trying to write an If statement that looks up a column in a Sharepoint list, whereby if at least two of three responses are selected, the form in my app is submitted. However, the column I am asking it to lookup has a space in it. I have tried the following formats and neither is accepted:

     

    'Name Name'

    'Name_x0020_Name' (with single quotes)

    Name_x0020_Name (without single quotes)

    {'Name Name': "text"}

    I do not know what the format should be. Any suggestions?

     

    Ange

  • HEATFreight Profile Picture
    1,020 on 26 Dec 2021 at 19:06:00
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    @BrianHFASPS This 1,000x this. đź’Żbravo sir, it drives me bananas too!


    @BrianHFASPS wrote:

    I am new to PowerApps and still learning. It seems sometimes the editor likes to column names with spaces to be entered as 'Student Last Name' and other times Student_x0020_Last_x0020_Name. Sometimes it autofills one and sometimes the other? Can anyone explain why?

     

    Also as an add-on question why does autofill with commands properly space over but autofill with column names does an overwrite of following text? Drives me nuts when the autofill erases a bunch on line since I never know when it is going to do it.




  • Community Power Platform Member Profile Picture
    on 26 Oct 2021 at 19:41:07
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    This is due to the fact that the column of interest is specified as Choice. When that happens, to get de value that a row displays in that column, you dont use

     

    datasource."column'.Text

     

    , but 

     

    datasource."column'.Value

     

     

  • Community Power Platform Member Profile Picture
    on 29 Dec 2020 at 18:25:07
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    I'm rather new at PowerApps, so there could be other factors involved of which I am unaware. However, I've found that instead of Name_x0020_Name, I need to use Name_x0020_Name.Value to make this work. 

  • Verified answer
    iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on 20 Dec 2018 at 10:11:52
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    Hi @BrianHFASPS & @PaulD1

     

    Can't answer why it may be suddenly changing throughout the app (although My experience is that when you open and refresh an App it may enable some of the preview features, which Display Column Names is currently pushed into), however I think I can give some thoughts on the other parts.

     

    I use SharePoint currently as a storage medium due to current company requirements, so I don't use the Search function as it's not delegable from SharePoint, So, I can't really know for sure what the backend of PowerApps does when dealing with these, but if we look at the documentation for these functions we can assume some kind of answer by making an educated guess:


    FilterTableFormula1 [, Formula2, ... ] )

    LookUpTableFormula [, ReductionFormula ] )

    ..So both of these functions are looking for a Formula, and my gut tells me that due to this, when searching by Display Name, a function will be able to discern the internal/static name from that.

     

    • I am also going to suggest here to never ever Ever use Display Name within your code - This is only a suggestion, but will save an infinite amount of potential issues that may arise should some person come along and decide that 'this column should have a more appropriate name' and then suddenly half of your apps no longer work and need to be republished/refreshed/etc. It's best practice to use a static name wherever possible 🙂

     

    So, getting back to the topic at hand,
    SearchTableSearchStringColumn1 [, Column2, ... ] )

    Description: 

    • Column(s) - Required. The names of columns within Table to search. Columns to search must contain text. Column names must be strings and enclosed in double quotes. However, the column names must be static and cannot be calculated with a formula. If SearchString is found within the data of any of these columns as a partial match, the full record will be returned.

     

    So we can see there that it outright states that column names must be static, so from the database side I would think it is only going to look for the internal/static name of the column, and they must be enclosed in double quotes.

     

    So, I would think (going back to original question) that it would depend on whether you are using the Search function rather than Lookup/Filter as to whether it wants:

     

    'Name Name' or Name_x0020_Name - which are usually interchangeable within Lookup()/Filter() due to it looking for a Formula (which I am Assuming can do intelligent lookups)

    or

    "Name_x0020_Name" - which will be looked for as an internal/static name by Search()

     

     

    If either of you have any counter-examples of this where the preview feature is disabled please do share, as this whole reply is going on my assumptions on how PowerApps is viewing and dealing with internal/static/display names within these functions based on the documentation provided 🙂

     

    Cheers,

    @iAm_ManCat

  • BrianHFASPS Profile Picture
    704 on 19 Dec 2018 at 22:51:48
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    One more addition to this I learned today. Search() will only accept "Student_x0020_Name" and not "Student Name" at least with SQL. It seems every other command with take with space but maybe since Search require "" instead of ''?

  • BrianHFASPS Profile Picture
    704 on 18 Dec 2018 at 22:32:32
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    It seems to work either way, it is just confusing sometimes where it seems to flip back and forth. Then the overwrite instead of insert on autofill is maddening. I do a lot of CTRL-Z or ESC to get back overwritten code.

  • PaulD1 Profile Picture
    2,914 on 18 Dec 2018 at 22:29:34
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    Could this be related to the Preview feature 'Use column display names'?

    I have noticed that the two naming conventions (spaces vs _x0020_) seem to be used inconsistently in some functions (SortByColumns springs to mind, but I'd need to check to be certain).

    I had one app where it would accept one convention and work but then after a few edits would force me to change all the names to the other convention, but I haven't had that recently, so perhaps it was resolved.

  • Community Power Platform Member Profile Picture
    on 18 Dec 2018 at 17:55:09
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    Hi @BrianHFASPS thanks for your post and sorry to hear you're experiencing these issues. 

     

    @iAm_ManCat are you able to assist with the updated information provided? 

     

    @Anonymous

  • BrianHFASPS Profile Picture
    704 on 05 Dec 2018 at 18:45:38
    Re: Column names with spaces 'Name Name' or Name_x0020_Name? Seems interchangeable sometimes?

    Are you using SharePoint as your storage medium by chance? 

    I was and then rebuilt app with storage being in an Azure SQL instance.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started