cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wahlbang
Regular Visitor

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
Dual Super User
Dual Super User

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,669)