cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Level 8

Incremental Values depending on Dropdown

I have an app that creates an Incident Number for each form that is submitted. I have 5 choices of Incident Types that the user can choose from. I want the incremental number to be a different sequence for each Incident Type.

 

Here is my formula for creating the Incident Number: 

TypeValue.Selected.Value & "-" & RptYearValue.Text & "-" & Last('[dbo].[wynne_incidents]').ID +1

 

How do I make different incremental number for each Type Value?

17 REPLIES 17
TimRohr
Level 10

Re: Incremental Values depending on Dropdown

If by having a different "sequence" you mean you want a different 1,2,3, etc. for Type A as from Type B, C, D, or E, then you can't base it off of an ID field which (I assume) increments for ALL Types. Either you have to base it on a field in your table that increments only for each Type, or instead of using Last()+1 you have to use a CountIf()+1 and test for your Type matching. It isn't delegatable, but then, neither is Last().

thunter
Level 8

Re: Incremental Values depending on Dropdown

Yes for example, right now I could have: ACC-2018-1, INC-2018-2, ACC-2018-3, etc.

but what I want is: ACC-2018-1, ACC-2018-2,.... and INC-2018-1, INC-2018-2, and so on with all of my Incident Types. The reason is because we like to be able to see a "quick look" of how many of a specific type we have in a year. Thanks! 

Super User
Super User

Re: Incremental Values depending on Dropdown

You can avoid delegation issues by using First(Sort(datasource,ID,descending)).ID+1 instead of Last() or Countif()
TimRohr
Level 10

Re: Incremental Values depending on Dropdown

I like the thinking there to get around the delegation issues, @Drrickryp, but how would you go about getting a Type-specific count? The formula you provided would get the next overall ID, but not an ID for the next Type A, for instance. Is there a way to do that while still avoiding delegation issues?

Super User
Super User

Re: Incremental Values depending on Dropdown

A different table for each type?

alsabea
Level: Powered On

Re: Incremental Values depending on Dropdown

i have a really dirty solution that could help you,with no delegation problem ,create five column(text) for each type of number,every time you submit the form make the right type column true  and the remain four false, then you can countrow filtered with the right column and set a variable +1 to the result of countrow.i hope it will help

TimRohr
Level 10

Re: Incremental Values depending on Dropdown

AFAIK, Countrows can't be delegated. Have you found differently?

alsabea
Level: Powered On

Re: Incremental Values depending on Dropdown

i used the same way used bz tutorial screen in powerapps,you can go and check if it is possible.

Super User
Super User

Re: Incremental Values depending on Dropdown

Hi @thunter,

Could you give us an estimate on the total number of items in your list and a breakdown of how many will be in each of the 5 categories. 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 267 members 3,928 guests
Please welcome our newest community members: