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 / What Brackets go where...
Power Apps
Answered

What Brackets go where and when do I use them

(0) ShareShare
ReportReport
Posted on by

Hi,

 

In access vba when you got a naming wrong (left space between words), or there was a invalid symbol used or the word was a control (part of the programming language) you placed it in brackets.

 

If I have "1.4_Comments"

and wish to use it in "1.4_Comments.Text"

Do I use square brackets or ....?

[1.4_Comments].Text

 

For Example because of the decimal point:

 

Patch(GeneralHSEAudit_Mobile, {[1.4_Comments]: EditScreen1.[1.4_Comments].text, [2.1_Plan]:EditScreen1.[2.1_Plan].Text........})

 

Both the "(" and The "{" are used in the programming syntex, what else is best practice?

Ta

 

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,393 Super User 2025 Season 2 on at

    Hi @Anonymous

    Single quotes are what we usually use to escape column names. In your example, the code would look something like this.

    Patch(GeneralHSEAudit_Mobile, 
     SourceRecordThatYouWantToPatch,
     {'1.4_Comments': EditScreen1.'1.4_Comments'.text, 
     '2.1_Plan':EditScreen1.'2.1_Plan'.Text........
    } )

    In terms of other best practice, I would recommend reading the best practice document here.

    https://pahandsonlab.blob.core.windows.net/documents/PowerApps%20canvas%20app%20coding%20standards%20and%20guidelines.pdf

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

    Based on the formula that you mentioned, I think there is something wrong with it. The '[' and ']' symbol could not be used to decorate a field name within your data source in PowerApps currently.

    I agree with @timl's thought almost. Currently, within PowerApps, the single quote is usually used to escape column names. If you have enabled/turned on the "Use column display names" functionality within Advanced settings of App settings of your app, you could reference the Display name of the columns of your data source within an app instead of logic names.

    Please check and see if the following blog would help in your scenario:

    https://powerapps.microsoft.com/en-us/blog/display-names-enters-preview-for-canvas-apps/

     

    On your side, please modify your formula as below:

    Patch( /* <-- Add new record into your data source */
    GeneralHSEAudit_Mobile,
    Defaults(GeneralHSEAudit_Mobile),
    {
    '1.4_Comments': EditScreen1.'1.4_Comments'.text,
    '2.1_Plan': EditScreen1.'2.1_Plan'.Text
    ...
    }
    )

    Note: The '1.4_Comments', '2.1_Plan', ... represent the Text Input box controls in your app. The '1.4_Comments', '2.1_Plan', ... represents the columns in your data source.

    Patch( /* <-- Modify existing record within your data source */
    GeneralHSEAudit_Mobile,
    LookUp(GeneralHSEAudit_Mobile, PrimaryColumn = "XXXXXX"), /* <-- Find the existing record you want to update */
    {
    '1.4_Comments': EditScreen1.'1.4_Comments'.text,
    '2.1_Plan': EditScreen1.'2.1_Plan'.Text
    ...
    }
    )

     

    Best regards,

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard