Skip to main content
Nintex Community Menu Bar
Question

How do I populate a model if it has just been required and has zero rows?


Forum|alt.badge.img+6

When a model is loaded for the first time it can be set to create a new record if no records match the criteria. I have a situation where I am re-querying a record and after that re-query I would like to create a new row if the model is empty. What is the best way to accomplish this.

Translate
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+17

How about a model action that creates a new row on requery?

Translate

Forum|alt.badge.img+6

The challenge I am running into is I only want one row in the model. Either the row it returns or the blank one if empty. I went ahead and added the new row on requery and now if the model query returns blank it works perfectly in that I see the blank fields and can enter a new value. The problem is if there is already a match then I see the matched record and then I see the blank record pop up which I don’t want. Are there conditions available for actions like there is for rendering or some clever way to only run a particular action if a model has 0 rows for example.

Translate

Forum|alt.badge.img+11

I assume that the model “Create default row if Model has none” option only applies to the first query.

How about running a Skuid JavaScript snippet on Model Requery.  You could test whether the model is empty and create a row if it is. 

Translate

Forum|alt.badge.img+17

I think Irvin’s solution is your only option to get exactly what you want. You can probably get 90% of the way there by requiring the user press a button to add a new row. Likely not a huge difference in the work flow.

Translate

Forum|alt.badge.img+6

Thank you Raymond and Irvin. For the short term I am going to go with adding the button to the work flow and rendering it when there are 0 rows which I agree should do the trick.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings