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 / Unique ID base on the ...
Power Apps
Unanswered

Unique ID base on the first 2 letters of 2 columns and the corresponding number of an item base on the look up

(0) ShareShare
ReportReport
Posted on by 42

I have a txtCSVData control where user can paste their comma separated values in this format:

Business Unit, Department, Project Name, User Name

and my trigger to push the data into my grid like gallery is control called btnImportCSV,

in that button i have a code that split the data entered in the txtCSVData which looks like this:

 

ClearCollect(
colDataImport,
ForAll(
Split(
CSVData.Text,
Char(10)
),
Split(
Value,
","
)

)
);
Reset(CSVData);
Back();

 

after it goes back to the previous screen, I need to generate the unique ID but how to I do that if I have this code already:

 

If(
CountRows(colDataImport) > 0,
Set(
varNumber,
varNumber + 1
);
ForAll(
colDataImport,
Collect(
colGridData,
Patch(
varNewRecord,
{
ID: varNumber,
// 'Process ID': GridProcessID.Text, // the code needs to go into the field called GridProcessID.Text and needs to be pushed into the sharepoint list
Date:Today(),
'Business Unit': First(ThisRecord.Value).Value,
Department: Last(
FirstN(
ThisRecord.Value,
2
)
).Value,
'Project Name': Last(
FirstN(
ThisRecord.Value,
3
)
).Value,
User: Last(
FirstN(
ThisRecord.Value,
4
)
).Value
}
)
)
)
);

 

Thank you!

 

Categories:
I have the same question (0)
  • Jsaunders Profile Picture
    12 on at

    To return the response of a PATCH function wrap it in a SET function

     

    Set(varResponse, Patch(SomeSource, Defaults(SomeSource), {ID: 1, Column: "Hello"}))

  • heyjay Profile Picture
    42 on at

    Hi @Jsaunders ,

     

    Thank you for the response. Can you please help me in details, where do I do the wrap?

    Will this create the desired value which is a concatenated value of (if the word count of the business unit is more than 2 words then get the first letter of each word and if the word count of the Department is more than 2 words then get the first letters of each word and look up the value of the Project name then concatenate all the result which should look like this (AABB-000) as an example.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard