cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShadowTech
Post Prodigy
Post Prodigy

User Profile office location determines number input

Hello,

 

Scenario,

 

When a new form is submitted it will automatically create a new number in the Title field of the SharePoint list (DataSource). When another New form is submitted, it will create the next number down. Ex. 08-000001, 08-000002. I have this formula working just fine. What I need to have happen is for the number to change based on the user office location..

 

Auto Populating formula

Set(vNewJobNum, Concatenate("08-", Text(Value(vLastJobNum)+1, "[$-en-US]000000")))

 

User profile 

If(varUser365Record.officelocation = "Fresno",

 

So basically, If the user 0fficelocation is "Fresno", The number needs to start with "08-". If from "Oakland", Then "05-".

 

Just having issues getting this to work.

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@ShadowTech 

Please consider changing your Formula to the following:

 

Set(vNewJobNum, 
   Switch(varUser365Record.officelocation,
       "Fresno", "08-",
       "Oakland", "05-"
   ) & Text(Value(vLastJobNum)+1, "[$-en-US]000000")
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@ShadowTech 

Please consider changing your Formula to the following:

 

Set(vNewJobNum, 
   Switch(varUser365Record.officelocation,
       "Fresno", "08-",
       "Oakland", "05-"
   ) & Text(Value(vLastJobNum)+1, "[$-en-US]000000")
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes Awesome brother! Thank you.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,361)