cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wahlbang
New Member

Unique ID when creating a form

Hi everyone,

I'm trying to create a knowledge database in Microsoft List / Sharepoint.

I would like when my colleagues creates and knowledge article the title gets an unique title / ID.

For exampel:
Title: KB0000001


And when the next person creates an article the title will be default be KB0000002 and so on and so on.
Think you get the point, but how do I do it? 🙄

Any bright brains out here that can help me?

Best regards,

Sebastian

5 REPLIES 5
gabibalaban
Super User II
Super User II

Hi @wahlbang ,

 

You didn't mention how you save the data in sharepoint ... using Patch () function or with a Form control. 

The formula you can use:

"KB"&
Text(
     Value(
            Right(
                  Last(yourdatasource).Title,7
                  )+1
     ),
     "0000000"
)

 

Hope it helps !

Hey @gabibalaban 

Thansk for the quick reply,

This is the code I see when I format the column in Sharepoint.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "box-sizing": "border-box",
    "padding": "0 2px"
  },
  "attributes": {
    "class": "sp-css-backgroundColor-neutralBackground"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "line-height": "16px",
        "height": "14px"
      },
      "attributes": {
        "iconName": ""
      }
    },
    {
      "elmType": "span",
      "style": {
        "overflow": "hidden",
        "text-overflow": "ellipsis",
        "padding": "0 3px"
      },
      "txtContent": "[$Title]",
      "attributes": {
        "class": ""
      }
    }
  ]
}


Should I do this is sharepoint or in Powerapps, i'm actually confused.

Hope you can help.

Best regards,
Wahlbang

@wahlbang ,

You actually ask for a solution based on share point column settings option, you’re question is not related to PowerApps app, right ?

@gabibalaban 
Yes, and no, because I and this to be a powerapp based on share point, but I guess you're right.

Hope I don't lost you there.


@wahlbang ,

well, if you use powerapps there are two options to save an item in a share point list:

1. Using a form linked to data source and in this case you need to use my formula inside update property of the Title data card.

2. Using patch () function in a formula like:

Patch(yourListName,Defaults(yourListName),{Title: myAboveFormula, ....})

where ... means the other values you want to save.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,295)