Skip to main content
Nintex Community Menu Bar
Question

How to loop all records of a model in the Branch Formula, within SKUID actions?

  • July 11, 2024
  • 2 replies
  • 4 views
  • Translate

Forum|alt.badge.img+2

I need to check the value of an updated field in a SKUID table, and run some actions based on it. As am unable to find a way to refer the edited record, I am trying to loop through all the records while updating and check the field values.

My exact requirement:

When the user tries to update the highlighted ‘Status’ field to ‘Complete-Approved’ or some other specific values manually, I need to block the UI, display a message of ‘Invalid Status’ and revert all the model changes.

The functionality works fine currently, when the user tries to update the first record in the table:

However, it does not work as expected when the ‘Status’ field in other records of the table is updated. 
To achieve this, I was trying to loop through the values in all the records of the table. If any of the values is not expected, I wish to show the ‘Invalid Status’ message and revert back model changes.

The current model actions set for this are shown here, along with the ‘Branch’ formula, which I wish to edit in particular. Instead of the hard-coded value of {{$Model.UwTasks.data.0.Status}} in the formula(which refers to the first record), I need to make this dynamic.

Any help with the issue?

Did this topic help you find an answer to your question?
This topic has been closed for comments

2 replies

Forum|alt.badge.img+7
  • Nintex Employee
  • 120 replies
  • July 11, 2024

In your branch logic, you’re telling it to only check the first row since you’re referencing it using global merge syntax (($Model.UwTasks.data.0.Status}}. What you probably want is to use contextual/row merge syntax, which would be {{Status}}. 

https://docs.skuid.com/latest/v1/en/skuid/merge-syntax/global-merge-variables.html#global-merge-variables

https://docs.skuid.com/latest/v1/en/skuid/merge-syntax/row-merge-variables.html

Translate

Forum|alt.badge.img+2
  • Author
  • 6 replies
  • July 11, 2024

Hi Matt,

This works for my case!

Thanks a lot!

Translate

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