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 / Concatenate multiple c...
Power Apps
Answered

Concatenate multiple column values plus ID to create a new column value during new record

(0) ShareShare
ReportReport
Posted on by 18

I'm trying to create a unique string that looks like this USA/F/IT&CL/100345.

I.e., (country code) / (foreign or domestic) / (department) / (series, planning to use the ID value)

 

This "number" needs to be created at the time the new record is created, in the 'Asset Tag" column, based on the values selected in other fields.

 

Where I'm getting stuck is where to do the concatenation?

And, if the record is new, how do I get the ID for the series number?

 

Thank you for any assistance!

 

Cheers, James

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @JamesNaylor If you are using SubmitForm() to create the new record, you can use the LastSubmit to get the ID of the last submitted record and then use it to create your string.

  • JamesNaylor Profile Picture
    18 on at

    Hi CNT,

    That sounds promising, thank you.

    I'll keep you posted.

  • JamesNaylor Profile Picture
    18 on at

    Hi CNT,

    I can't find LastSubmit. Is it a property or a function?

    Also, when and where would I use it? 

     

    For testing I've tried the following command line on the form's 'OnSuccess' property. Although the record is added the 'Asset Tag' column doesn't get updated.

     

    Patch('VS Asset Tags (tablet source)',Defaults('VS Asset Tags (tablet source)'),{'Asset Tag':"james"})

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @JamesNaylor It's a function. After you submit the Form, in the OnSuccess property of the Form, you can do something like, yourForm.LastSubmit.ID

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at
  • JamesNaylor Profile Picture
    18 on at

    Thank you CNT...Funny, document search didn't find it.

     

    I understand the approach, i.e., frmTagEntry.LastSubmit.ID returns the record ID...thank you for this tip.

     

    But I'm stuck trying to simply update the field "Asset Tag", for the record just added.

     

    I tried Patch({'Asset Tag': "12345"}) on the form's OnSuccess property, but no joy.

    I'm struggling to find an example of updating a column of a record.

    Any tips?

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @JamesNaylor Patch needs the datasource and the record that you want to modify. For syntax, see here, https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-patch#syntax

  • JamesNaylor Profile Picture
    18 on at

    Yes, I know what you're saying...I was just trying one of the examples from the docs.

    "Patch( { Name: "Contoso", Phone: "1-212-555-1234" }, { Name: "Contoso", Location: "Midtown" } )"

     

    But thanks to you I finally worked it out...it occurred to me that LastSubmit would bring the focus to the record I just created for Patch to work on.

     

    Thank you very much for your assistance!

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 421

#2
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 278 Super User 2026 Season 1

Last 30 days Overall leaderboard