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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (10,858)