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

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.

 

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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (4,045)