cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
halifaxious
Resolver I
Resolver I

automate record creation when required field is autoincrement

I created a table, PRA_Score where the primary name column is an autonumber.

halifaxious_0-1628097288256.png

Now I want to use Power Automate to automatically create PRA_Score records when an action happens. But I can't figure out what to put in the primary name column since it is insisting I must put something there.

halifaxious_1-1628097426514.png

I suppose I could look up the last PRA_Score record, parse the name (score_####), increment the number and concatenate a new name for the new record. But that feels really kludgy. Is there a better way?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisPiasecki
Super User
Super User

Hi @halifaxious,

 

You can pass the Null expression to get past the required validation in your Flow. The platform will take care of populating the name with the generated AutoNumber on the server side. See my working example below:

 

ChrisPiasecki_0-1628098611795.png

ChrisPiasecki_1-1628098651719.png

ChrisPiasecki_2-1628098730450.png

 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

 

View solution in original post

5 REPLIES 5
ChrisPiasecki
Super User
Super User

Hi @halifaxious,

 

You can pass the Null expression to get past the required validation in your Flow. The platform will take care of populating the name with the generated AutoNumber on the server side. See my working example below:

 

ChrisPiasecki_0-1628098611795.png

ChrisPiasecki_1-1628098651719.png

ChrisPiasecki_2-1628098730450.png

 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

 

View solution in original post

Carlosr
Microsoft
Microsoft

I typically change AutoNumber fields to not-required since the system will populate it for you.  Also, ensure that the field is read-only on any forms so that it can't be changed.

I don't believe the primary name field can be changed to optional. That was the issue.  Using the null() expression solved the problem.

Carlosr
Microsoft
Microsoft

The primary name field can be set to optional:

Carlosr_0-1628107186878.png

 

 

This is the recommended approach since it is the intended behavior.  Otherwise, all applications, flows and services that attempt to create a record will need to account for this.

Good to know. Thanks!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,243)